[Twisted-Python] Multiple transmissions via SMTPClient

Jason J. W. Williams jasonjwwilliams at gmail.com
Wed May 23 13:10:44 MDT 2012

Hi Guys,

I've been banging my head on this for a few days so I thought I'd ping
folks here. Been trying to modify twisted.mail.smtp.ESMTPClient to
allow the sending of more than one message over a single TCP
connection. I've changed the  behavior of smtpState_data() so that it
sets the next state to smtpState_from if there is another message to
send, and this seems to work unless there's an error returned by the
server. In this case the connection is still closed on the client side
after smtpState_msgSent, and I need to suppress this. The subsequent
message should still be sent on the open TCP connection error or not,
according to my needs, however I'm having a heck of time tracking down
where the disconnection is occurring.

My current code (with debugging statements) is here:

Any help is greatly appreciated. This client is being used to run
functional tests.


More information about the Twisted-Python mailing list