From 7d2158a75b6ff294146444a6e1b51170d3f43010 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Fri, 14 Jun 2024 23:21:59 -0400 Subject: mlmmj: Integration with postfix Incoming mail for an mlmmj list is caught by a virtual mapping and directed via virtual transport to the mlmmj system for processing. Outgoing mail is implicitly allowed since it originates from the localhost. The postfix entrypoint script now dynamically generates these mailing list mappings on startup from data in the mlmmj spool directory, so user configuration is minimal. In addition, the script will now sync the user's mailing list parameters into the spool directory, thus automatically creating new lists and deleting old ones. The list creation logic is implemented in a new script `make_list.sh`. This is made necessary as the mlmmj built in tooling for this must be run interactively, so we duplicate the logic. This is separate from `entrypoint.sh` mainly because we need to drop privileges to the mlmmj user while creating files. Signed-off-by: Malfurious --- postfix/make_list.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 postfix/make_list.sh (limited to 'postfix/make_list.sh') diff --git a/postfix/make_list.sh b/postfix/make_list.sh new file mode 100755 index 0000000..45a198e --- /dev/null +++ b/postfix/make_list.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +mkdir -p "/var/spool/mlmmj/$1" +cd "/var/spool/mlmmj/$1" + +mkdir -p incoming queue queue/discarded archive subconf unsubconf bounce \ + moderation subscribers.d digesters.d requeue nomailsubs.d + +touch index +ln -s "/etc/userconfig/lists/$1" control +ln -s /etc/userconfig/listtext text + +printf 'Created list directory: %s\n' "$(pwd)" -- cgit v1.2.3