On 8/9/22 07:19, Stephen J. Turnbull wrote:
You don't do it with HyperKitty (I'm pretty sure you can export mboxes from HyperKitty, but I don't think it would be timely, you have to do it by hand). The sample archiver (which you can enable in mailman.cfg IIRC, haven't done it in a while) would make the mbox files directly from the core at the same time that they are sent to HyperKitty. It's possible to have both HyperKitty and the sample archiver enabled at the same time.
The sample archiver
is actually called the prototype archiver and it
is typically enabled by default.
The messages are stored in maildir format in Mailman's var/archives/prototype/ directory in sub-directories with names of the list posting addresses. You would need to convert maildir to mbox format to import to hyperkitty. A simple script to do this is
#!/usr/bin/python3
"""Run this with the list posting address as it's argument."""
import os
import sys
from mailbox import mbox, Maildir
MDIR = '/path/to/mailman/var/archives/prototype/'
MBOX = '/path/to/output_directory'
if len(sys.argv) != 2:
print(f'Usage: {sys.argv[0]} list_posting_address', file=sys.stderr)
sys.exit(1)
mdir = Maildir(os.path.join(MDIR, sys.argv[1]), create=False)
mlbox = mbox(os.path.join(MBOX, sys.argv[1]), create=True)
for msg in mdir:
mlbox.add(msg)
mdir.close()
mlbox.close()
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan