Package lamson :: Module mail :: Class MailRequest
[hide private]
[frames] | no frames]

Class MailRequest

source code


This is what's handed to your handlers for you to process. The information you get out of this is *ALWAYS* in Python unicode and should be usable by any API. Modifying this object will cause other handlers that deal with it to get your modifications, but in general you don't want to do more than maybe tag a few headers.

Instance Methods [hide private]
 
__init__(self, Peer, From, To, Data)
Peer is the remote peer making the connection (sometimes the queue name).
source code
 
all_parts(self)
Returns all multipart mime parts.
source code
 
body(self)
Always returns a body if there is one.
source code
 
__contains__(self, key) source code
 
__getitem__(self, name) source code
 
__setitem__(self, name, val) source code
 
__delitem__(self, name) source code
 
__str__(self)
Converts this to a string usable for storage into a queue or transmission.
source code
 
__repr__(self)
repr(x)
source code
 
keys(self) source code
 
to_message(self)
Converts this to a Python email message you can use to interact with the python mail APIs.
source code
 
walk(self)
Recursively walks all attached parts and their children.
source code
 
is_bounce(self, threshold=0.3)
Determines whether the message is a bounce message based on lamson.bounce.BounceAnalzyer given threshold.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]
  msg

Inherited from object: __class__

Method Details [hide private]

__init__(self, Peer, From, To, Data)
(Constructor)

source code 

Peer is the remote peer making the connection (sometimes the queue name). From and To are what you think they are. Data is the raw full email as received by the server.

NOTE: It does not handle multiple From headers, if that's even possible. It will parse the From into a list and take the first one.

Overrides: object.__init__

all_parts(self)

source code 

Returns all multipart mime parts. This could be an empty list.

body(self)

source code 

Always returns a body if there is one. If the message is multipart then it returns the first part's body, if it's not then it just returns the body. If returns None then this message has nothing for a body.

__contains__(self, key)
(In operator)

source code 

__getitem__(self, name)
(Indexing operator)

source code 

__setitem__(self, name, val)
(Index assignment operator)

source code 

__delitem__(self, name)
(Index deletion operator)

source code 

__str__(self)
(Informal representation operator)

source code 

Converts this to a string usable for storage into a queue or transmission.

Overrides: object.__str__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

keys(self)

source code 

to_message(self)

source code 

Converts this to a Python email message you can use to interact with the python mail APIs.

walk(self)

source code 

Recursively walks all attached parts and their children.

is_bounce(self, threshold=0.3)

source code 

Determines whether the message is a bounce message based on lamson.bounce.BounceAnalzyer given threshold. 0.3 is a good conservative base.


Property Details [hide private]

msg

Get Method:
unreachable.msg(self)