smtplib bug with Windows XP

Peter Hansen peter at
Mon Jan 24 22:05:02 EST 2005

stewart.midwinter at wrote:
> I'm having problem with a script that used to work under Win2k but is
> now broken after an install of WinXP Pro.  I can no longer connect to a
> local mail server.  Has anyone else seen this?  If so, were you able to
> work around it?  Here's the traceback (below).  

The usual first step to troubleshooting such a problem is to
use Telnet to connect manually.  Type this "telnet 25"
and see what you get.  If it appears correct (it helps to know
some of the SMTP protocol: you should get a "220" response here
plus the host's name), type "helo" or something like
that to see the response.  "Help" is usually a valid command
at this point.  If you can't do this manually, then smtplib
certainly cannot either.

 > Interestingly, if I
> change ports to the POP port 110, I get a different error, but one that
> lets me know that I can reach the server.

"ping" would let you know you can reach the server as well,
but using SMTP to connect to a POP3 server is perhaps a
somewhat more complicated and hopeless, but interesting
way to do the same thing. <wink>

>>>>s = smtplib.SMTP('',25)
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "C:\Programs\Python24\Lib\", line 241, in __init__
> (code, msg) = self.connect(host, port)
> File "C:\Programs\Python24\Lib\", line 303, in connect
> raise socket.error, msg
> socket.error: (10053, 'Software caused connection abort')

Try manually, but think about these options: a firewall that
has suddenly been enabled, an SMTP server that now requires
authentication, some kind of proxy like what virus scanners
use (though why they would intercept outgoing mail I don't


More information about the Python-list mailing list