Skip to content Skip to sidebar Skip to footer

Custom Response To Data With Twisted Python Smtp?

How can I specify a custom error code/response to a DATA command using Twisted's SMTP? In eomReceived in the code, I want to return a failure with a custom string. Right now, I can

Solution 1:

You need to:

  • subclass ESTMP
  • implement a do_DATA on your subclass (see twisted.mail.smtp.SMTP for examples)

the SMTP base class's lineReceived will receive your line, pass it on to state_COMMAND (assuming it's in command state), which will look up the method starting with do_ to pass the rest of the line to.

Post a Comment for "Custom Response To Data With Twisted Python Smtp?"