class documentation

A class representing the IETF email archive.

Method __init__ Initialise the MailArchive.
Method mailing_list Return an object representing the given mailing list.
Method mailing_list_names Yield the names of the mailing lists that exist in the mail archive.
Method message Return the envelopes for all messages with the specified `message_id`.
Method messages Return the envelopes of all specified messages in the archive.
Method update Update the local cache of the messages from all the mailing lists.
Instance Variable _db Undocumented
Instance Variable _fs Undocumented
Instance Variable _imap_server Undocumented
Instance Variable _log Undocumented
Instance Variable _mailing_lists Undocumented
Instance Variable _mongoclient Undocumented
def __init__(self, imap_server: str = 'imap.ietf.org', mongodb_hostname: str = 'localhost', mongodb_port: str = '27017', mongodb_username: Optional[str] = None, mongodb_password: Optional[str] = None):

Initialise the MailArchive.

def mailing_list(self, mailing_list_name: str) -> MailingList:

Return an object representing the given mailing list.

def mailing_list_names(self) -> Iterator[str]:

Yield the names of the mailing lists that exist in the mail archive.

def message(self, message_id: str) -> List[Envelope]:

Return the envelopes for all messages with the specified `message_id`.

There can be multiple copies of a message with a particular ID in the archive if it was sent to multiple lists. This method returns all the copies, since each copy might have a different set of replies. For example, message "<396c8d37-f979-73fe-34fa-475a038b94f8@alum.mit.edu>" appears in the archives of the "art", "last-call", and "tsvwg" lists.

def messages(self, received_after: str = '1970-01-01T00:00:00', received_before: str = '2038-01-19T03:14:07', header_from: Optional[str] = None, header_to: Optional[str] = None, header_subject: Optional[str] = None, mailing_list: Optional[str] = None) -> Iterator[Envelope]:

Return the envelopes of all specified messages in the archive.

def update(self, verbose=True):

Update the local cache of the messages from all the mailing lists.

This method should be called when working with a complete copy of the mail archive to synchronise the local copy with the IETF IMAP server.

To only download a subset of the messages, use the `mailing_list()` method to get a MailingList object for the lists of interest, then call the `update()` method on those objects.

WARNING: The first time this method is called, it will download the entire mail archive. This will take several hours and download tens of gigabytes of data. Subsequent calls will just fetch new data and so will be much faster.

_db: Database =

Undocumented

_fs: GridFS =

Undocumented

_imap_server: str =

Undocumented

_log: logging.Logger =

Undocumented

_mailing_lists: Dict[str, MailingList] =

Undocumented

_mongoclient: MongoClient =

Undocumented