Package twisted :: Package protocols :: Module smtp :: Class IMessageDelivery

[frames | no frames]

## Class IMessageDelivery

    Interface --+
                |
               IMessageDelivery

Method Summary
`str` | ``receivedHeader`(self, helo, origin, recipients)` Generate the Received header for a message
`Deferred` or `Address` | ``validateFrom`(self, helo, origin)` Validate the address from which the message originates.
no-argument callable | ``validateTo`(self, user)` Validate the address for which the message is destined.

Method Details

### receivedHeader(self, helo, origin, recipients)

Generate the Received header for a message

  Parameters:
    `helo` - The argument to the HELO command and the client's IP address.
    (type=`(str, str)`)
    `origin` - The address the message is from
    (type=`Address`)
    `recipients` - A list of the addresses for which this message is bound.
    (type=`list` of `str`)
  Returns:
    The full "Received" header string.
    (type=`str`)

### validateFrom(self, helo, origin)

Validate the address from which the message originates.

  Parameters:
    `helo` - The argument to the HELO command and the client's IP address.
    (type=`(str, str)`)
    `origin` - The address the message is from
    (type=`Address`)
  Returns:
    `origin` or a `Deferred` whose callback will be passed `origin`.
    (type=`Deferred` or `Address`)
  Raises:
    `SMTPBadSender` - Raised of messages from this address are not to be accepted.

### validateTo(self, user)

Validate the address for which the message is destined.

  Parameters:
    `user` - The address to validate.
    (type=`User`)
  Returns:
    A `Deferred` which becomes, or a callable which takes no arguments and returns an object implementing `IMessage`. This will be called and the returned object used to deliver the message when it arrives.
    (type=no-argument callable)
  Raises:
    `SMTPBadRcpt` - Raised if messages to the address are not to be accepted.

Generated by Epydoc 2.0 on Sat May 15 20:08:18 2004 | http://epydoc.sf.net