How It Works


How to use Mailman with Postfix without fiddling with postfix's config files.

A problem with mailman is that, when you create or delete a list, you have to synchronize your /etc/aliases file. There's more than one way to do it, see mailman's documentation for the standard way. What we use here is different: regular expressions in postfix's virtual maps.

Let's see how it works:

A full domain is used by the list manager. A message arriving for truc@listes.rezo.net is handled for list truc, and not the user truc. (Note: this domain can be hidden entirely from users, via more virtuals.)

In Postfix's configuration, we just declare mailman calls in a generic way (independently of the list name, that we'll have to pass in the variable $EXTENSION):

mmbot_post: "|/var/local/mailman/mail/mailman post $EXTENSION"
mmbot_request: "|/var/local/mailman/mail/mailman request $EXTENSION"
mmbot_owner: "|/var/local/mailman/mail/mailman owner $EXTENSION"
mmbot_join: "|/var/local/mailman/mail/mailman join $EXTENSION"
mmbot_leave: "|/var/local/mailman/mail/mailman leave $EXTENSION"
mmbot_confirm: "|/var/local/mailman/mail/mailman confirm $EXTENSION"
mmbot_admin: "|/var/local/mailman/mail/mailman bounces $EXTENSION"
mmbot_bounces: "|/var/local/mailman/mail/mailman bounces $EXTENSION"
mmbot_post_verif: "| test -d /var/local/mailman/lists/$EXTENSION && /var/local/mailman/mail/mailman post $EXTENSION"

- we also call a regexp virtual, in order to pass the list name in the variable $EXTENSION, via an address of the form mailman-action+listname@...

virtual_maps = hash:$config_directory/virtual,
recipient_delimiter = +
mailbox_command = /usr/bin/procmail -a "$EXTENSION"

# mandatory
/^(postmaster|root|abuse)@listes\.rezo\.net$/   $1@rezo.net
# aliases /^(.+)-(subscribe|on)@(listes\.rezo\.net)$/ $1-join@$3 /^(.+)-(unsubscribe|off)@(listes\.rezo\.net)$/ $1-leave@$3 # commands
/^(.+)-(post|admin|request|owner|join|leave|confirm)@(listes\.)?rezo\.net$/ mmbot_$2+$1
# lists (command -post)
/^([-a-zA-Z0-9_]+)@listes\.rezo\.net$/ mailman-post+$1

* * *

Hope this can help... (in French)

(You might want to check Dax Kelson's slightly different approach, called postfix-to-mailman.py.)




[X] Une initiative de Rezo.net, le portail des copains