Go to the latest version of this document.

# ``twisted`.`mail`.`mail`.`FileMessage``

class documentation

`class FileMessage: (source)`

Known subclasses: `twisted.mail.maildir.MaildirMessage`

Constructor: `FileMessage(fp, name, finalName)`

Implements interfaces: `twisted.mail.interfaces.IMessageSMTP`

View In Hierarchy

A message receiver which delivers a message to a file.

Method | `__init__` | No summary
Method | `connectionLost` | Delete the file holding the partially received message.
Method | `eomReceived` | At the end of message, rename the file holding the message to its final name.
Method | `lineReceived` | Write a received line to the file.
Instance Variable | `finalName` | See `__init__`.
Instance Variable | `fp` | See `__init__`.
Instance Variable | `name` | See `__init__`.

def __init__(self, fp, name, finalName): (source)
overridden in `twisted.mail.maildir.MaildirMessage`

Parameters
fp:file-like object | The file in which to store the message while it is being received.
name:`bytes` | The full path name of the temporary file.
finalName:`bytes` | The full path name that should be given to the file holding the message after it has been fully received.

def connectionLost(self): (source)
from `twisted.mail.interfaces.IMessageSMTP`

Delete the file holding the partially received message.

def eomReceived(self): (source)
from `twisted.mail.interfaces.IMessageSMTP`
overridden in `twisted.mail.maildir.MaildirMessage`

At the end of message, rename the file holding the message to its final name.

Returns
`Deferred` which successfully results in `bytes` | A deferred which returns the final name of the file.

def lineReceived(self, line): (source)
from `twisted.mail.interfaces.IMessageSMTP`
overridden in `twisted.mail.maildir.MaildirMessage`

Write a received line to the file.

Parameters
line:`bytes` | A received line.

finalName = (source)
overridden in `twisted.mail.maildir.MaildirMessage`

See `__init__`.

fp = (source)

See `__init__`.

name = (source)

See `__init__`.