class documentation

class twisted.mail.maildir.MaildirDirdbmDomain(AbstractMaildirDomain): (source)

Implements interfaces: twisted.cred.portal.IRealm

View In Hierarchy

A maildir-backed domain where membership is checked with a DirDBM database.

The directory structure of a MaildirDirdbmDomain is:

/passwd <-- a DirDBM directory

/USER/{cur, new, del} <-- each user has these three directories

Instance Variable postmaster See __init__.
Instance Variable dbm The authentication database for the domain.
Class Variable portal Undocumented
Method __init__
Method userDirectory Return the path to a user's mail directory.
Method addUser Add a user to this domain by adding an entry in the authentication database and initializing the user's mail directory.
Method getCredentialsCheckers Return credentials checkers for this domain.
Method requestAvatar Get the mailbox for an authenticated user.
Instance Variable _credcheckers Undocumented

Inherited from AbstractMaildirDomain:

Instance Variable alias A mapping of username to alias.
Instance Variable root See __init__.
Method setAliasGroup Set the group of defined aliases for this domain.
Method exists Check whether a user exists in this domain or an alias of it.
Method startMessage Create a maildir message for a user.
Method willRelay Check whether this domain will relay.
postmaster = (source)
See __init__.
The authentication database for the domain.
(type: DirDBM)
portal = (source)

Undocumented

_credcheckers = (source)

Undocumented

def __init__(self, service, root, postmaster=0): (source)
ParametersserviceAn email service. (type: MailService)
rootThe maildir root directory. (type: bytes)
postmasterA flag indicating whether non-existent addresses should be forwarded to the postmaster (True) or bounced (False). (type: bool)
def userDirectory(self, name): (source)

Return the path to a user's mail directory.

ParametersnameA username. (type: bytes)
ReturnsThe path to the user's mail directory for a valid user. For an invalid user, the path to the postmaster's mailbox if bounces are redirected there. Otherwise, None. (type: bytes or None)
def addUser(self, user, password): (source)

Add a user to this domain by adding an entry in the authentication database and initializing the user's mail directory.

ParametersuserA username. (type: bytes)
passwordA password. (type: bytes)
def getCredentialsCheckers(self): (source)

Return credentials checkers for this domain.

ReturnsCredentials checkers for this domain. (type: list of ICredentialsChecker provider)
def requestAvatar(self, avatarId, mind, *interfaces): (source)

Get the mailbox for an authenticated user.

The mailbox for the authenticated user will be returned only if the given interfaces include IMailbox. Requests for anonymous access will be met with a mailbox containing a message indicating that an internal error has occurred.

ParametersavatarIdA string which identifies a user or an object which signals a request for anonymous access. (type: bytes or twisted.cred.checkers.ANONYMOUS)
mindUnused. (type: None)
interfacesA group of interfaces, one of which the avatar must support. (type: n-tuple of zope.interface.Interface)
ReturnsA tuple of the supported interface, a mailbox, and a logout function. (type: 3-tuple of (0) IMailbox, (1) IMailbox provider, (2) no-argument callable)
RaisesNotImplementedErrorWhen the given interfaces do not include IMailbox.
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.