Re: python/smtplib fails on rebuilt system
On Tue, Mar 17, 2009 at 10:30:49 -0700, Frank Miles wrote:
> 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:
>
> import smtplib
> s= smtplib.SMTP('localhost')
>
> but this causes an error with 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.
Check if exim is really listening on port 25:
# netstat -plant | grep ':25 '
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3271/exim4
Try
s=smtplib.SMTP('127.0.0.1')
to see if the problem is related to resolving "localhost".
--
Regards, | http://users.icfo.es/Florian.Kulzer
Florian |
Reply to: