This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jafo
Recipients jafo, khiltd, loewis
Date 2008-03-19.22:40:32
SpamBayes Score 0.31501204
Marked as misclassified No
Message-id <1205966434.44.0.384548876866.issue2132@psf.upfronthosting.co.za>
In-reply-to
Content
smtplib is for sending messages via SMTP, not for testing to see if a
user is behind an ISP that is incorrectly blocking outgoing SMTP
connections.  I would argue the "incorrectly" because they are dropping
rather than rejecting the connection packets.

One mechanism would be to use an alarm(30) call which would limit the
whole transaction to 30 seconds (connection, EHLO, RCPT, QUIT), not just
the connection.  My experience with dealing with remote machines in a
time-sensitive manner is that this approach is much more usable than
using socket timeouts.

A better mechanism is probably to use non-blocking socket I/O directly
and make connections to all or many of the remote servers and test them
in parallel, meaning all servers could be tested in 30 seconds (or
whatever your timeout is) rather than 5 minutes (you imply in your
message that you may be doing more than a dozen requests).

So, I believe the current functionality in the smtplib of being simple
and conservative at trying to get messages through, rather than trying
to be optimized for checking for account existance, is reasonable.  And
that in any case, using alarm() is a better solution than socket timeouts.
History
Date User Action Args
2008-03-19 22:40:34jafosetspambayes_score: 0.315012 -> 0.31501204
recipients: + jafo, loewis, khiltd
2008-03-19 22:40:34jafosetspambayes_score: 0.315012 -> 0.315012
messageid: <1205966434.44.0.384548876866.issue2132@psf.upfronthosting.co.za>
2008-03-19 22:40:33jafolinkissue2132 messages
2008-03-19 22:40:32jafocreate