class documentation

class Options(usage.Options, strcred.AuthOptionMixin): (source)

View In Hierarchy

An options list parser for twistd mail.
Method __init__ Parse options and create a mail service.
Method add​Endpoint Add an endpoint to a service.
Method opt​_aliases Specify an aliases(5) file to use for the last specified domain.
Method opt​_bounce​_to​_postmaster Send undeliverable messages to the postmaster.
Method opt​_default Make the most recently specified domain the default domain.
Method opt​_maildirdbmdomain Generate an SMTP/POP3 virtual domain.
Method opt​_pop3 Add a POP3 port listener on the specified endpoint.
Method opt​_smtp Add an SMTP port listener on the specified endpoint.
Method opt​_user Add a user and password to the last specified domain.
Method post​Options Check the validity of the specified set of options and configure authentication.
Instance Variable comp​Data Metadata for the shell tab completion system.
Instance Variable last​_domain The most recently specified domain.
Instance Variable longdesc A long description of the plugin for use in the usage message.
Instance Variable opt​Flags Information about supported flags. See Options for details.
Instance Variable opt​Parameters Information about supported parameters. See Options for details.
Instance Variable service The email service.
Instance Variable synopsis A description of options for use in the usage message.
Method _get​Endpoints Return a list of endpoints for the specified service, constructing defaults if necessary.
Instance Variable _proto​Defaults A mapping of default service to port.

Inherited from Options:

Method __str__ Undocumented
Method get​Synopsis Returns a string containing a description of these options and how to pass them to the executed file.
Method get​Usage Undocumented
Method opt​_help Display this help and exit.
Method opt​_version Display Twisted version and exit.
Method parse​Args I am called with any leftover arguments which were not options.
Method parse​Options The guts of the command-line parser.
Class Variable completion​Data Undocumented
Class Variable default​Sub​Command Undocumented
Class Variable parent Undocumented
Instance Variable defaults Undocumented
Instance Variable docs Undocumented
Instance Variable long​Opt Undocumented
Instance Variable opts Undocumented
Instance Variable short​Opt Undocumented
Instance Variable sub​Command Undocumented
Instance Variable sub​Options Undocumented
Instance Variable synonyms Undocumented
Method _gather​_flags Gather up boolean (flag) options.
Method _gather​_handlers Gather up options with their own handler methods.
Method _gather​_parameters Gather options which take a value.
Method _generic​_flag Undocumented
Instance Variable _dispatch Undocumented

Inherited from AuthOptionMixin:

Method add​Checker Supply a supplied credentials checker to the Options class.
Method opt​_auth Specify an authentication method for the server.
Method opt​_help​_auth Show all authentication methods available.
Method opt​_help​_auth​_type Show help for a particular authentication type.
Method supports​Checker​Factory Returns whether a checker factory will provide at least one of the credentials interfaces that we care about.
Method supports​Interface Returns whether a particular credentials interface is supported.
Class Variable auth​Output A writeable object to which this options class will send all help-related output. Default: sys.stdout
Class Variable supported​Interfaces An iterable object that returns credential interfaces which this application is able to support.
Method _checker​Factories​For​Opt​Help​Auth Return a list of which authTypes will be displayed by --help-auth. This makes it a lot easier to test this module.
def __init__(self): (source)
Parse options and create a mail service.
def addEndpoint(self, service, description): (source)
Add an endpoint to a service.
Parameters
service:bytesA service, either b'smtp' or b'pop3'.
description:bytesAn endpoint description string or a TCP port number.
def opt_aliases(self, filename): (source)
Specify an aliases(5) file to use for the last specified domain.
def opt_bounce_to_postmaster(self): (source)
Send undeliverable messages to the postmaster.
def opt_default(self): (source)
Make the most recently specified domain the default domain.
def opt_maildirdbmdomain(self, domain): (source)

Generate an SMTP/POP3 virtual domain.

This option requires an argument of the form 'NAME=PATH' where NAME is the DNS domain name for which email will be accepted and where PATH is a the filesystem path to a Maildir folder. [Example: 'example.com=/tmp/example.com']

def opt_pop3(self, description): (source)

Add a POP3 port listener on the specified endpoint.

You can listen on multiple ports by specifying multiple --pop3 options.

def opt_smtp(self, description): (source)

Add an SMTP port listener on the specified endpoint.

You can listen on multiple ports by specifying multiple --smtp options.

def opt_user(self, user_pass): (source)
Add a user and password to the last specified domain.
def postOptions(self): (source)
Check the validity of the specified set of options and configure authentication.
Raises
UsageErrorWhen the set of options is invalid.
Metadata for the shell tab completion system.
last_domain: IDomain provider or None = (source)
The most recently specified domain.
longdesc: bytes = (source)
A long description of the plugin for use in the usage message.
optFlags: list of list of (0) bytes, (1) bytes or None, (2) bytes = (source)
Information about supported flags. See Options for details.
optParameters: list of list of (0) bytes, (1) bytes, (2) object, (3) bytes, (4) None or callable which takes bytes and returns object = (source)
Information about supported parameters. See Options for details.
The email service.
synopsis: bytes = (source)
A description of options for use in the usage message.
def _getEndpoints(self, reactor, service): (source)

Return a list of endpoints for the specified service, constructing defaults if necessary.

If no endpoints were configured for the service and the protocol was not explicitly disabled with a --no-* option, a default endpoint for the service is created.

Parameters
reactor:IReactorTCP providerIf any endpoints are created, the reactor with which they are created.
service:bytesThe type of service for which to retrieve endpoints, either b'pop3' or b'smtp'.
Returns
list of IStreamServerEndpoint providerThe endpoints for the specified service as configured by the command line parameters.
_protoDefaults: dict mapping bytes to int = (source)
A mapping of default service to port.