RKrahl / archive-tools

Tools for managing archives
Apache License 2.0
1 stars 2 forks source link

Add a header with version information to the mailarchive index #51

Closed RKrahl closed 3 years ago

RKrahl commented 3 years ago

Add a header (a separate YAML document) to the .mailindex.yaml in mail archives created by class MailArchive. The header contains the following metadata:

Close #50.

The legacy mail index as created by the current archive-tools release that does contain this metadata header has retroactively been attributed version 1.0. The mail index as created by this pull request is version 1.1. Future archive-tools versions changing the mail index format or semantic should increment this version number.

Note a subtle difference between the date in the mail index metadata and the date in the manifest: the date in the mail index is the moment that it is instantiated, which happens before the download of the messages in the imap-to-archive.py script. The date in the manifest is the moment that the archive is created which happens after the download of all messages in imap-to-archive.py. The difference may sum up to a few minutes, which justifies recording both dates.

The server may be set in a new keyword argument to MailArchive(). The default is None.

Incompatible change: the comment keyword argument to MailArchive() has been dropped. Previously, this comment ended up in a YAML comment at the beginning of the mail index. This was not machine readable and was not very useful. It has mainly been used to note the sever and and date that the messages have been downloaded from and is now superseded by the new metadata header.