update README

This commit is contained in:
Max Erenberg 2021-04-10 01:57:39 -04:00
parent a1dec6a0b2
commit 35b32dc925
4 changed files with 25 additions and 15 deletions

View File

@ -15,24 +15,29 @@ pip3 install .
```
## MonthlyArchiver
MonthlyArchiver simply gzips
each message and stores it in a folder named by the year and month. Each
message's file name is a Unix epoch timestamp.
This archiver stores each message in a maildir folder for the message's year
and month.
The motivation behind `MonthlyArchiver` was to avoid storing thousands of
messages in a single directory, which the `Prototype` archiver currently
does since it uses a maildir.
does.
Example directory structure:
```
/var/lib/mailman3/archives
\_ monthly_archiver
\_ mylist@mydomain.com
\_ 2021-April
\_ 1617678398.173.mail.gz
\_ 1617678805.351.mail.gz
\_ 2021-May
\_ ...
/var/lib/mailman3/archives/
|-- monthly_archiver/
|-- mylist@mydomain.com/
|-- 2021/
|-- April/
| |-- cur/
| |-- new/
| | |-- 1618032020.M509265P87123Q1.mail
| | |-- 1618032509.M464173P87208Q1.mail
| |-- tmp/
|-- May/
|-- cur/
|-- new/
|-- tmp/
```
To enable this archiver, add the following to your mailman.cfg:

View File

@ -1,6 +1,6 @@
[metadata]
name = extra-mailman-archivers
version = 0.0.2
version = 0.0.3
author = Max Erenberg
author_email = merenber@csclub.uwaterloo.ca
description = Some extra archivers for Mailman 3

View File

@ -73,7 +73,7 @@ class MonthlyArchiver:
This archiver saves messages into a maildir for the current year and
month, e.g. '2021/April'.
:type mlist: mailman.model.listmanager.ListManager
:type mlist: mailman.interfaces.mailinglist.IMailingList
:type message: mailman.email.message.Message
"""
message_id = message.get('message-id')

View File

@ -84,7 +84,12 @@ class Pipermail:
return None
def archive_message(self, mlist, msg):
"""See `IArchiver`."""
"""
See `IArchiver`.
:type mlist: mailman.interfaces.mailinglist.IMailingList
:type message: mailman.email.message.Message
"""
# Mangle the 'From ' lines and add the Unix envelope header.
fp = BytesIO()
g = BytesGenerator(fp, mangle_from_=True)