class documentation

Undocumented

Method __init__ Undocumented
Method add_metadata Add metadata relating to the message in this envelope.
Method clear_metadata Remove metadata relating to the message in this envelope.
Method contents Return the Message contained within this Envelope.
Method date The "Date:" header from the Message within this Envelope, parsed into a `DateTime` object.
Method date_received Undocumented
Method get_metadata Get metadata relating to the message in this envelope.
Method header Accessor for the headers of the message in this Envelope.
Method header_message_id Accesor for the message-id header of the message in this Envelope.
Method in_reply_to Return the envelopes containing the messages that this is in reply to.
Method mailing_list Undocumented
Method replies Return the envelopes containing the messages sent in reply to this.
Method size Undocumented
Method uid Undocumented
Method uidvalidity Undocumented
Instance Variable _dste_received Undocumented
Instance Variable _gridfs_id Undocumented
Instance Variable _headers Undocumented
Instance Variable _mailing_list Undocumented
Instance Variable _size Undocumented
Instance Variable _uid Undocumented
Instance Variable _uidvalidity Undocumented
def __init__(self, ml: MailingList, uidvalidity: int, uid: int, gridfs_id: int, date_received: datetime, size: int, headers: Dict[str, List[str]]):

Undocumented

def add_metadata(self, project: str, key: str, value):

Add metadata relating to the message in this envelope. Parameters: - `project` -- the project or user to which this metadata relates - `key` -- the key under which the metadata should be scored - `value` -- the value of the metadata to store

def clear_metadata(self, project: str, key: Optional[str] = None):

Remove metadata relating to the message in this envelope. Parameters: - `project` -- the project or user to which this metadata relates - `key` -- the key under which the metadata was scored If the `key` is specified then only the single metadata value identified by the `project` and `key` is removed. If the `key` is not specified, then all metadata relating to the project is removed from this envelope.

def contents(self) -> Message:

Return the Message contained within this Envelope.

def date(self) -> Optional[datetime]:

The "Date:" header from the Message within this Envelope, parsed into a `DateTime` object.

This will return `None` if the "Date:" header is not present or cannot be parsed.

The `header("date")` method can be used to return the unparsed "Date:" header as a `str`.

def date_received(self) -> datetime:

Undocumented

def get_metadata(self, project: str, key: str):

Get metadata relating to the message in this envelope. Parameters: - `project` -- the project or user to which this metadata relates - `key` -- the key under which the metadata was scored

def header(self, header_name: str) -> List[str]:

Accessor for the headers of the message in this Envelope.

Some headers, e.g., "Received:" are expected to occur multiple times within a message and will return a list containing multiple items.

Other headers, e.g., "From:", are only supposed to occur once in each message. In these cases, this method should return a list containing a single value. Note, however, that the IETF mail archive contains some malformed messages with unexpected duplicate headers. For example, there are some messages with two addresses in the "From:" line.

def header_message_id(self) -> str:

Accesor for the message-id header of the message in this Envelope.

Returns a string containing the message-id. In case this header is repeated, the value that is encountered last is returned. In case the header is missing the return value is None.

def in_reply_to(self) -> List[Envelope]:

Return the envelopes containing the messages that this is in reply to.

Each message can only be in reply to a single other message, but there may be multiple copies of that message in the archive if it was sent to multiple lists, each of which may itself have different replies. This method returns all such copies.

If this is the first message in a thread, then an empty list is returned.

def mailing_list(self) -> MailingList:

Undocumented

def replies(self) -> List[Envelope]:

Return the envelopes containing the messages sent in reply to this.

def size(self) -> int:

Undocumented

def uid(self) -> int:

Undocumented

def uidvalidity(self) -> int:

Undocumented

_dste_received: datetime =

Undocumented

_gridfs_id: int =

Undocumented

_headers: Dict[str, List[str]] =

Undocumented

_mailing_list: MailingList =

Undocumented

_size: int =

Undocumented

_uid: int =

Undocumented

_uidvalidity: int =

Undocumented