class documentation

class AbstractMaildirDomain: (source)

Known subclasses: twisted.mail.maildir.MaildirDirdbmDomain

Implements interfaces: twisted.mail.interfaces.IAliasableDomain

View In Hierarchy

An abstract maildir-backed domain.
Method __init__
Method add​User Add a user to this domain.
Method exists Check whether a user exists in this domain or an alias of it.
Method get​Credentials​Checkers Return credentials checkers for this domain.
Method set​Alias​Group Set the group of defined aliases for this domain.
Method start​Message Create a maildir message for a user.
Method user​Directory Return the maildir directory for a user.
Method will​Relay Check whether this domain will relay.
Instance Variable alias A mapping of username to alias.
Instance Variable root See __init__.
def __init__(self, service, root): (source)
Parameters
service:MailServiceAn email service.
root:bytesThe maildir root directory.
def addUser(self, user, password): (source)

Add a user to this domain.

Subclasses should override this method.

Parameters
user:bytesA username.
password:bytesA password.
def exists(self, user, memo=None): (source)
Check whether a user exists in this domain or an alias of it.
Parameters
user:UserA user.
memo:None or dict of AliasBaseA record of the addresses already considered while resolving aliases. The default value should be used by all external code.
Returns
no-argument callable which returns IMessage provider.A function which takes no arguments and returns a message receiver for the user.
Raises
SMTPBadRcptWhen the given user does not exist in this domain or an alias of it.
def getCredentialsCheckers(self): (source)

Return credentials checkers for this domain.

Subclasses should override this method.

Returns
list of ICredentialsChecker providerCredentials checkers for this domain.
def setAliasGroup(self, alias): (source)
Set the group of defined aliases for this domain.
Parameters
alias:dict mapping bytes to IAlias provider.A mapping of domain name to alias.
def startMessage(self, user): (source)
Create a maildir message for a user.
Parameters
user:bytesA username.
Returns
MaildirMessageA message receiver for this user.
def userDirectory(self, user): (source)
Return the maildir directory for a user.
Parameters
user:bytesA username.
Returns
bytes or NoneThe user's mail directory for a valid user. Otherwise, None.
def willRelay(self, user, protocol): (source)
Check whether this domain will relay.
Parameters
user:AddressThe destination address.
protocol:SMTPThe protocol over which the message to be relayed is being received.
Returns
boolAn indication of whether this domain will relay the message to the destination.
alias: None or dict mapping bytes to AliasBase = (source)
A mapping of username to alias.