class MailArchive:
Constructor: MailArchive(imap_server, mongodb_hostname, mongodb_port, mongodb_username, mongodb_password)
A class representing the IETF email archive.
Method | __init__ |
Initialise the MailArchive. |
Method | mailing |
Return an object representing the given mailing list. |
Method | mailing |
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 |
Undocumented |
Instance Variable | _log |
Undocumented |
Instance Variable | _mailing |
Undocumented |
Instance Variable | _mongoclient |
Undocumented |
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.
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.
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.
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.