
t.maintz@fz-juelich.de writes:
The trick to zero delivery downtime is that you can configure your MTA to route to Mailman 3 if the list exists there, if not route to Mailman 2 if the list exists there, and if not continue to any lower priority routes. It worked as designed (mops sweat off brow ;-).
Can you tell me how to implement this in Postfix?
Postfix has plugins to query PostgreSQL, MySQL, and SQLite databases. Debian, Ubuntu, and SuSE at least have postfix-pgsql packages to install it. I can't speak to other flavors of OS distro or SQL database server. Here's the configuration for the queries:
# Save this in a file named /etc/mailman3/virtual.cf hosts = $YOUR_POSTGRES_HOST:5432 # usually localhost user = mailman # almost always password = $PASSWORD # for the mailman user in Postgres dbname = mailman # almost always # If you serve multiple mailman domains where list names may collide, # I think you should use (WHERE list_name = '%u' AND mail_host = '%d') # including the parentheses (I think SQL complains without them) query = SELECT list_id FROM mailinglist WHERE list_name = '%u' # This returns the input query verbatim result_format = %S
Copy that file to /etc/mailman3/transport.cf, and change the last line to result_format = lmtp:127.0.0.1:8024
Here's how I invoked it in Postfix's main.cf:
transport_maps = hash:/etc/mailman3/transport.cf virtual_alias_domains = $THE_LIST_DOMAIN virtual_alias_maps = pgsql:/etc/mailman3/virtual.cf hash:/var/lib/mailman/data/mailman-aliases # I don't recall exactly
I'm not sure what Postfix does if Postgres is down or the 'mailman' database in PostgreSQL doesn't exist (the mailinglist table can be empty, though).
This worked for me because (1) there are no user local addresses on the list domain, only a few roles like root and postmaster handled as aliases, (2) email commands were disabled. I'm sure there are alternative strategies if virtual_alias_domains won't work for you. <https://www.postfix.org/VIRTUAL_README.html#virtual_alias> was useful for me.
Postfix also knows internally how to check if a mailbox exists at a server. I don't know if you can exploit this, but if it's possible, you can use the same strategy that is described for Exim4 in the Mailman documentation.
Steve