update README
This commit is contained in:
parent
a1dec6a0b2
commit
35b32dc925
29
README.md
29
README.md
|
@ -15,24 +15,29 @@ pip3 install .
|
||||||
```
|
```
|
||||||
|
|
||||||
## MonthlyArchiver
|
## MonthlyArchiver
|
||||||
MonthlyArchiver simply gzips
|
This archiver stores each message in a maildir folder for the message's year
|
||||||
each message and stores it in a folder named by the year and month. Each
|
and month.
|
||||||
message's file name is a Unix epoch timestamp.
|
|
||||||
|
|
||||||
The motivation behind `MonthlyArchiver` was to avoid storing thousands of
|
The motivation behind `MonthlyArchiver` was to avoid storing thousands of
|
||||||
messages in a single directory, which the `Prototype` archiver currently
|
messages in a single directory, which the `Prototype` archiver currently
|
||||||
does since it uses a maildir.
|
does.
|
||||||
|
|
||||||
Example directory structure:
|
Example directory structure:
|
||||||
```
|
```
|
||||||
/var/lib/mailman3/archives
|
/var/lib/mailman3/archives/
|
||||||
\_ monthly_archiver
|
|-- monthly_archiver/
|
||||||
\_ mylist@mydomain.com
|
|-- mylist@mydomain.com/
|
||||||
\_ 2021-April
|
|-- 2021/
|
||||||
\_ 1617678398.173.mail.gz
|
|-- April/
|
||||||
\_ 1617678805.351.mail.gz
|
| |-- cur/
|
||||||
\_ 2021-May
|
| |-- new/
|
||||||
\_ ...
|
| | |-- 1618032020.M509265P87123Q1.mail
|
||||||
|
| | |-- 1618032509.M464173P87208Q1.mail
|
||||||
|
| |-- tmp/
|
||||||
|
|-- May/
|
||||||
|
|-- cur/
|
||||||
|
|-- new/
|
||||||
|
|-- tmp/
|
||||||
```
|
```
|
||||||
|
|
||||||
To enable this archiver, add the following to your mailman.cfg:
|
To enable this archiver, add the following to your mailman.cfg:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = extra-mailman-archivers
|
name = extra-mailman-archivers
|
||||||
version = 0.0.2
|
version = 0.0.3
|
||||||
author = Max Erenberg
|
author = Max Erenberg
|
||||||
author_email = merenber@csclub.uwaterloo.ca
|
author_email = merenber@csclub.uwaterloo.ca
|
||||||
description = Some extra archivers for Mailman 3
|
description = Some extra archivers for Mailman 3
|
||||||
|
|
|
@ -73,7 +73,7 @@ class MonthlyArchiver:
|
||||||
This archiver saves messages into a maildir for the current year and
|
This archiver saves messages into a maildir for the current year and
|
||||||
month, e.g. '2021/April'.
|
month, e.g. '2021/April'.
|
||||||
|
|
||||||
:type mlist: mailman.model.listmanager.ListManager
|
:type mlist: mailman.interfaces.mailinglist.IMailingList
|
||||||
:type message: mailman.email.message.Message
|
:type message: mailman.email.message.Message
|
||||||
"""
|
"""
|
||||||
message_id = message.get('message-id')
|
message_id = message.get('message-id')
|
||||||
|
|
|
@ -84,7 +84,12 @@ class Pipermail:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def archive_message(self, mlist, msg):
|
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.
|
# Mangle the 'From ' lines and add the Unix envelope header.
|
||||||
fp = BytesIO()
|
fp = BytesIO()
|
||||||
g = BytesGenerator(fp, mangle_from_=True)
|
g = BytesGenerator(fp, mangle_from_=True)
|
||||||
|
|
Loading…
Reference in New Issue