Go to the latest version of this document.

# ``twisted`.`mail`.`alias`.`FileAlias``

class documentation

`class FileAlias(AliasBase): (source)`

Constructor: `FileAlias(filename, *args)`

Implements interfaces: `twisted.mail.interfaces.IAlias`

View In Hierarchy

An alias which translates an address to a file.

Method | `__init__` | No summary
Method | `__str__` | Build a string representation of this `FileAlias` instance.
Method | `createMessageReceiver` | Create a message receiver which delivers a message to the file.
Instance Variable | `filename` | See `__init__`.

Inherited from `AliasBase`:

Method | `domain` | Return the domain associated with original address.
Method | `resolve` | Map this alias to its ultimate destination.
Instance Variable | `domains` | See `__init__`.
Instance Variable | `original` | The original address being aliased.

def __init__(self, filename, *args): (source)
overrides `twisted.mail.alias.AliasBase.__init__`

Parameters
filename:`bytes` | The name of the file in which to store the message.
*args:2-`tuple` of (0) `dict` mapping `bytes` to `IDomain` provider, (1) `bytes` | Arguments for `AliasBase.__init__`.

def __str__(self) -> `str`: (source)

Build a string representation of this `FileAlias` instance.

Returns
`bytes` | A string containing the name of the file.

def createMessageReceiver(self): (source)
from `twisted.mail.interfaces.IAlias`

Create a message receiver which delivers a message to the file.

Returns
`FileWrapper` | A message receiver which writes a message to the file.

filename = (source)

See `__init__`.