[Twisted-Python] Re: Reactor is left dirty after calling twisted.mail.smtp.sendmail via trial

Marcin Kasperski Marcin.Kasperski at softax.com.pl
Tue Feb 26 09:40:54 EST 2008


> Am I wrong?

I took a deeper look. Looks like it is caused by the way smtp.py
works. More or less, at least for my naive eye, it seems to me
that the deferred returned from sendmail/sendEmail is fired as
soon as email sending is done, and cleanup (closing smtp connection,
removing factory etc) proceeds asynchronously.

In real code it is likely good thing as you need not to wait for
final message exchanges.

Not sure whether it is possible to do anything with that (without 
rewriting the module deeply) :-(

  { it would be test-friendly if sendmail either returned two
    deferreds, one fired after send, second after cleanup, or
    had option to sync returned deferred on cleanup... }


-- 
----------------------------------------------------------------------
| Marcin Kasperski   |    You have the right to accept your
| http://mekk.waw.pl | responsibilites instead of having them
|                    |         assigned to you. (Beck)
----------------------------------------------------------------------





More information about the Twisted-Python mailing list