class documentation

A base class for message delivery using the domains of a mail service.

Method __init__ No summary
Method receivedHeader Generate a received header string for a message.
Method validateFrom Validate the address from which a message originates.
Method validateTo Validate the address for which a message is destined.
Instance Variable host See __init__
Instance Variable protocolName The protocol being used to deliver the mail. Sub-classes should set this appropriately.
Instance Variable service See __init__
Instance Variable user See __init__
def __init__(self, service, user, host=smtp.DNSNAME): (source)
Parameters
service:MailServiceA mail service.
user:bytes or NoneThe authenticated SMTP user.
host:bytesThe hostname.
def receivedHeader(self, helo, origin, recipients): (source)

Generate a received header string for a message.

Parameters
helo:2-tuple of (bytes, bytes)The client's identity as sent in the HELO command and its IP address.
origin:AddressThe origination address of the message.
recipients:list of UserThe destination addresses for the message.
Returns
bytesA received header string.
def validateFrom(self, helo, origin): (source)

Validate the address from which a message originates.

Parameters
helo:2-tuple of (bytes, bytes)The client's identity as sent in the HELO command and its IP address.
origin:AddressThe origination address of the message.
Returns
AddressThe origination address.
Raises
SMTPBadSenderWhen messages cannot be accepted from the origination address.
def validateTo(self, user): (source)

Validate the address for which a message is destined.

Parameters
user:UserThe destination address.
Returns
Deferred which successfully fires with no-argument callable which returns IMessage provider.A deferred which successfully fires with a no-argument callable which returns a message receiver for the destination.
Raises
SMTPBadRcptWhen messages cannot be accepted for the destination address.
protocolName: bytes = (source)

The protocol being used to deliver the mail. Sub-classes should set this appropriately.