smtplib problem with newly rebuilt Debian/lenny system

C

cassiope

A hard drive failure forced me to rebuild my main system. Just a few
things haven't been restored; one of them is a python script which is
used to email users of important events.

In attempting to diagnose the cause, I tried directly executing the
lines inside the python2.5 interpreter:

import smtplib
s= smtplib.SMTP('localhost')

but the second line causes a traceback:

File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/smtplib.py", line 244, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python2.5/smtplib.py", line 310, in connect
raise socket.error, msg
socket.error: (97, 'Address family not supported by protocol')

This is with exim4 and python2.5 on a newly installed lenny system.
No error messages appear in /var/log or /var/log/exim4 directories.

Helpful clues or pointers to relevant documentation would be
appreciated!

-f
 
A

Aahz

[posted & e-mailed, please respond to newsgroup]

In attempting to diagnose the cause, I tried directly executing the
lines inside the python2.5 interpreter:

import smtplib
s= smtplib.SMTP('localhost')

but the second line causes a traceback:

File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/smtplib.py", line 244, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python2.5/smtplib.py", line 310, in connect
raise socket.error, msg
socket.error: (97, 'Address family not supported by protocol')

This is with exim4 and python2.5 on a newly installed lenny system.
No error messages appear in /var/log or /var/log/exim4 directories.

What happens if you
telnet localhost 25

This looks like a network setup issue.
--
Aahz ([email protected]) <*> http://www.pythoncraft.com/

"At Resolver we've found it useful to short-circuit any doubt and just
refer to comments in code as 'lies'. :)"
--Michael Foord paraphrases Christian Muirhead on python-dev, 2009-3-22
 
C

cassiope

[posted & e-mailed, please respond to newsgroup]

cassiope   said:
In attempting to diagnose the cause, I tried directly executing the
lines inside the python2.5 interpreter:
       import  smtplib
       s= smtplib.SMTP('localhost')
but the second line causes  a traceback:
       File "<stdin>", line 1, in <module>
       File "/usr/lib/python2.5/smtplib.py", line 244, in __init__
           (code, msg) = self.connect(host, port)
       File "/usr/lib/python2.5/smtplib.py", line 310, in connect
           raise socket.error, msg
       socket.error: (97, 'Address family not supported by protocol')
This is with exim4 and python2.5 on a newly installed lenny system.
No error messages appear in /var/log or /var/log/exim4 directories.

What happens if you
telnet localhost 25

This looks like a network setup issue.
--
Aahz ([email protected])           <*>        http://www.pythoncraft.com/

"At Resolver we've found it useful to short-circuit any doubt and just
refer to comments in code as 'lies'. :)"
--Michael Foord paraphrases Christian Muirhead on python-dev, 2009-3-22

Yes, that's what it was. Exim4 setup was bungled, so wasn't accepting
localhost
connections. Fixing that resolved the "python" error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top