[Stuart D. Gathman]
>>> I need to set a timelimit for the operation of
>>> smtplib.sendmail. It has to be thread based, because pymilter uses
>>> libmilter which is thread based.
[Alan Kennedy]
>> Have you tried setting a default socket timeout, which applies to all
>> socket operations?
[Stuart
On Tue, 25 Jul 2006 09:21:40 -0700, Alan Kennedy wrote:
> [Stuart D. Gathman]
>> I need to set a timelimit for the operation of
>> smtplib.sendmail. It has to be thread based, because pymilter uses
>> libmilter which is thread based.
>
> Have you tried setting a default socket timeout, which app
[Stuart D. Gathman]
> I need to set a timelimit for the operation of
> smtplib.sendmail. It has to be thread based, because pymilter uses
> libmilter which is thread based. There are some cookbook recipies which
> run a function in a new thread and call Thread.join(timeout). This
> doesn't help,
I am doing SMTP callbacks in a Python milter
(http://pymilter.sourceforge.net) using the smtplib module. For some
spammer MXes, it takes days (!) before smtplib.sendmail will return.
Since the spammer connects to us every few seconds, this quickly leads to
a problem :-)
I need to set a timelimit