On 4/1/23 09:39, pknowles@tpnsolutions.com wrote:
I'm playing around with installing Mailman Core, and want to have messages on a "per-list" basis sent to a special "archiver" address which I intend to make archives available at via a custom built "read-only" IMAP client.
How would I go about having messages sent to this external address, short of adding the address as a subscriber?
See https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/archiving/proto... for an example of an archiver that implements Mailman's IArchiver interface.
You could make something similar with an archive_message() method that sends the message to your IMAP server, or possibly you could just implement your IMAP client to serve messages from the existing var/archives/prototype/ hierarchy. Messages for lists with the prototype archiver enabled are stored there in maildir format by list name. To enable the prototype archiver, you may need to put
[archiver.prototype] enable: yes
in your mailman.cfg.
To make your own archiver, create a python module, say my_archive.py, that defines a My_Archive class implementing the IArchiver interface.
Put that module somewhere where mailman can import it and put something like
[archiver.my_archiver] class: import.path.my_archive.My_Archive enable: yes
where import.path.my_archive.My_Archive is the actual path that is imported. For example if Mailman is installed in a venv, you could put my_archiver.py in the venv's site-packages directory and then the class would be just
class: my_archive.My_Archive
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan