interface documentation

class IMessageDelivery(Interface): (source)

Known implementations: twisted.mail.protocols.DomainDeliveryBase

View In Hierarchy

Undocumented

Method receivedHeader Generate the Received header for a message.
Method validateFrom Validate the address from which the message originates.
Method validateTo Validate the address for which the message is destined.
def receivedHeader(helo, origin, recipients): (source)

Generate the Received header for a message.

Parameters
helo:2-tuple of bytes and bytes.The argument to the HELO command and the client's IP address.
origin:AddressThe address the message is from
recipients:list of UserA list of the addresses for which this message is bound.
Returns
bytesThe full "Received" header string.
def validateFrom(helo, origin): (source)

Validate the address from which the message originates.

Parameters
helo:2-tuple of bytes and bytes.The argument to the HELO command and the client's IP address.
origin:AddressThe address the message is from
Returns
Deferred or Addressorigin or a Deferred whose callback will be passed origin.
Raises
SMTPBadSenderRaised of messages from this address are not to be accepted.
def validateTo(user): (source)

Validate the address for which the message is destined.

Parameters
user:UserThe address to validate.
Returns
no-argument callableA Deferred which becomes, or a callable which takes no arguments and returns an object implementing IMessageSMTP. This will be called and the returned object used to deliver the message when it arrives.
Raises
SMTPBadRcptRaised if messages to the address are not to be accepted.