[Twisted-Python] what's a workaround for Ticket #3472 (sendmail has no timeout)?

Glyph Lefkowitz glyph at twistedmatrix.com
Sat Aug 1 22:22:28 EDT 2009

On Sat, Aug 1, 2009 at 2:54 PM, Dave Britton <dave at davebritton.com> wrote:

> What would be the best way for me to work around this?

Fix the bug :).  Then, I hope, contribute a patch... (see
http://twistedmatrix.com/trac/wiki/TwistedDevelopment for that part).

> Specifically, when I use twisted.mail.smtp sendmail() for a lengthy list, I
> fairly quickly get the "too many open files" message.
 (more detailed description of the problem snipped)

Yeah, that sounds like your problem is #3472.  There are two problems there:
one is that the default behavior is such that you run out of file
descriptors, and the other is that the behavior can't be customized.  The
customization issue should probably be fixed first, and then the default
behavior can be fixed by tweaking the default values for the customizations.

or option2: Patch a timeout argument into sendmail to have it passed to
> SMTPSenderFactory(from_addr, to_addrs, msg, d)? Would this work? I can't
> figure out how or if SMTPSenderFactory would handle a timeout argument.

I think this is what would be meant by "fixing the bug"; your description
seems a bit too vague for me to tell if your solution would be solving it in
a general way or not, but at first blush it seems about right.

Sorry for the long message. Thanks for your advice!

No need to apologize.  Thanks for your interest, and good luck!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20090801/659f66e2/attachment.htm 

More information about the Twisted-Python mailing list