class documentation

class MailService(service.MultiService): (source)

View In Hierarchy

An email service.
Method __init__ Initialize the mail service.
Method add​Domain Add a domain for which the service will accept email.
Method default​Portal Return the portal for the default domain.
Method get​ESMTPFactory Create an ESMTP protocol factory.
Method get​POP3​Factory Create a POP3 protocol factory.
Method get​SMTPFactory Create an SMTP protocol factory.
Method lookup​Portal Find the portal for a domain.
Method request​Avatar Return a message delivery for an authenticated SMTP user.
Method set​Queue Set the queue for outgoing emails.
Instance Variable aliases A mapping of domain name to alias.
Instance Variable domains A mapping of supported domain name to domain object.
Instance Variable monitor A service to monitor changes to files.
Instance Variable portals A mapping of domain name to authentication portal.
Instance Variable queue A queue for outgoing messages.
Instance Variable smtp​Portal A portal for authentication for the SMTP server.

Inherited from MultiService:

Method __iter__ Get an iterator over all child services.
Method add​Service Add a child service.
Method get​Service​Named Get the child service with a given name.
Method privileged​Start​Service Do preparation work for starting the service.
Method remove​Service Remove a child service.
Method start​Service Start the service.
Method stop​Service Stop the service.
Instance Variable named​Services Undocumented
Instance Variable parent An IServiceCollection which is the parent or None.
Instance Variable services Undocumented

Inherited from Service (via MultiService):

Method __getstate__ Undocumented
Method disown​Service​Parent Use this API to remove an IService from an IServiceCollection.
Method set​Name Set the name of the service.
Method set​Service​Parent Set the parent of the service. This method is responsible for setting the parent attribute on this service (the child service).
Instance Variable name A str which is the name of the service or None.
Instance Variable running A boolean which indicates whether the service is running.
def __init__(self): (source)
Initialize the mail service.
def addDomain(self, name, domain): (source)
Add a domain for which the service will accept email.
Parameters
name:bytesA domain name.
domain:IDomain providerA domain object.
def defaultPortal(self): (source)

Return the portal for the default domain.

The default domain is named ''.

Returns
PortalThe portal for the default domain.
def getESMTPFactory(self): (source)
Create an ESMTP protocol factory.
Returns
ESMTPFactoryAn ESMTP protocol factory.
def getPOP3Factory(self): (source)
Create a POP3 protocol factory.
Returns
POP3FactoryA POP3 protocol factory.
def getSMTPFactory(self): (source)
Create an SMTP protocol factory.
Returns
SMTPFactoryAn SMTP protocol factory.
def lookupPortal(self, name): (source)
Find the portal for a domain.
Parameters
name:bytesA domain name.
Returns
PortalA portal.
def requestAvatar(self, avatarId, mind, *interfaces): (source)
Return a message delivery for an authenticated SMTP user.
Parameters
avatar​Id:bytesA string which identifies an authenticated user.
mind:NoneUnused.
*interfaces:n-tuple of zope.interface.InterfaceA group of interfaces one of which the avatar must support.
Returns
3-tuple of (1) IMessageDelivery, (2) ESMTPDomainDelivery, (3) no-argument callableA tuple of the supported interface, a message delivery, and a logout function.
Raises
NotImplementedErrorWhen the given interfaces do not include IMessageDelivery.
def setQueue(self, queue): (source)
Set the queue for outgoing emails.
Parameters
queue:QueueA queue for outgoing messages.
aliases: None or dict of bytes -> IAlias provider = (source)
A mapping of domain name to alias.
domains: dict of bytes -> IDomain provider = (source)
A mapping of supported domain name to domain object.
A service to monitor changes to files.
portals: dict of bytes -> Portal = (source)
A mapping of domain name to authentication portal.
queue: Queue or None = (source)
A queue for outgoing messages.
smtpPortal: Portal = (source)
A portal for authentication for the SMTP server.