[Mailman-Users] again postfix+aliases+virtual_domains

Mark Sapiro mark at msapiro.net
Sun Dec 16 19:00:56 CET 2012

On 12/16/2012 7:20 AM, ДП wrote:
> Hi, all
> After reading kilometers of posts looks like that subject is a stone of stumble when integratnig mailman with postfix. But, please, don`t scold at me, because I really don`nt get how to glue together my working postfix with virtual domains and one single mailman list.
> system info: archlinux, postfix 2.9.4, kernel 3.6.9 x64, mailman 2.1.15
> <code>
> $ postconf|grep alias

Sigh... where to start ...

First of all, when trying to communicate Postfix configurations,
unedited, full output from `postconf -n` with possible munging of domain
names (only if done consistently) is almost always preferable.

> alias_database = $alias_maps
> alias_maps = hash:/var/lib/mailman/data/aliases, hash:/etc/postfix/aliases
> allow_mail_to_commands = alias, forward, include
> allow_mail_to_files = alias, forward, include
> expand_owner_alias = no
> local_recipient_maps = proxy:unix:passwd.byname $alias_maps
> newaliases_path = /usr/bin/newaliases
> proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $sender_bcc_maps $recipient_bcc_maps $smtp_generic_maps $lmtp_generic_maps $alias_maps
> reset_owner_alias = no
> unknown_virtual_alias_reject_code = 550
> virtual_alias_domains = $virtual_alias_maps
> virtual_alias_expansion_limit = 1000
> virtual_alias_maps = hash:/var/lib/mailman/data/virtuailman,al-m mysql:/etc/postfix/mysql_virtual_alias_maps.cf
> virtual_alias_recursion_limit = 1000
> </code>
> <code>
> # mm_cfg.py
> MTA = 'Postfix'
> DEFAULT_EMAIL_HOST = 'my-domain.com.ua'
> DEFAULT_URL_HOST = 'mail2.my-domain.com.ua'
> DEFAULT_URL_PATTERN = 'http://mail2.my-domain.com.ua/mylist/'

DEFAULT_URL_PATTERN gets interpolated with the host name and the
listname gets appended, so if you want to drop the '/mailman' from
Mailman URLs, set

DEFAULT_URL_PATTERN = 'http://%s/'

Otherwise, the setting in Defaults.py

DEFAULT_URL_PATTERN = 'http://%s/mailman/'

should be fine without any mm_cfg.py override.

> POSTFIX_STYLE_VIRTUAL_DOMAINS = ['my-domain.com.ua']
> VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'my-domain.com.ua'

The above is clearly wrong. Either 'my-domain.com.ua' is a virtual
domain in Postfix or it is a local domain. If it is a local domain, you
don't want either of the above two lines and you don't want
'hash:/var/lib/mailman/data/virtuailman' in Postfix virtual_alias_maps.

If ti is a virtual domain in Postfix, you absolutely don't want


as that will map the virtual address mylist at my-domain.com.ua to the
supposedly local address mylist at my-domain.com.ua, which at best is a
loop. Normally, setting VIRTUAL_MAILMAN_LOCAL_DOMAIN in mm_cfg.py is not
required, but if it is set, it needs to be set to one of the domains in
Postfix my_destination, e.g. 'localhost'.

> </code>
> All aliases files was generated by genaliases, and I did`nt modified them.
> All of them are under the mailman.mailman user rights =rw----.
> <code>
> ## /var/lib/mailman/data/aliases
> # The ultimate loop stopper address mylist-loop:
> /var/lib/mailman/data/owner-bounces.mbox
> # STANZA START: mylist
> # CREATED: Sun Dec 16 16:53:24 2012
> mylist:             /var/lib/mailman/qfiles/maildir/
> mylist-admin:       /var/lib/mailman/qfiles/maildir/
> mylist-bounces:     /var/lib/mailman/qfiles/maildir/
> mylist-confirm:     /var/lib/mailman/qfiles/maildir/
> mylist-join:        /var/lib/mailman/qfiles/maildir/
> mylist-leave:       /var/lib/mailman/qfiles/maildir/
> mylist-owner:       /var/lib/mailman/qfiles/maildir/
> mylist-request:     /var/lib/mailman/qfiles/maildir/
> mylist-subscribe:   /var/lib/mailman/qfiles/maildir/
> mylist-unsubscribe: /var/lib/mailman/qfiles/maildir/
> # STANZA END: mylist

Something is very wrong here. The above aliases indicate you have set


but I don't see that in mm_cfg.py above. In any case, maildir delivery
to Mailman is experimental, as far as I know no one uses it, and it also
requires that MaildirRunner be enabled. See the documentation in

> </code>
> <code>
> ## /var/lib/mailman/data/virtual-mailman
> mylist-loop at my-domain.com.ua	mylist-loop at my-domain.com.ua
> # STANZA START: mylist
> # CREATED: Sun Dec 16 16:53:24 2012
> mylist at my-domain.com.ua              mylist at my-domain.com.ua

Here we see the mappings I mentioned above. The 'virtual' addresses are
mapped to themselves which can't work.

> mylist-admin at my-domain.com.ua        mylist-admin at my-domain.com.ua
> mylist-bounces at my-domain.com.ua      mylist-bounces at my-domain.com.ua
> mylist-confirm at my-domain.com.ua      mylist-confirm at my-domain.com.ua
> mylist-join at my-domain.com.ua         mylist-join at my-domain.com.ua
> mylist-leave at my-domain.com.ua        mylist-leave at my-domain.com.ua
> mylist-owner at my-domain.com.ua        mylist-owner at my-domain.com.ua
> mylist-request at my-domain.com.ua      mylist-request at my-domain.com.ua
> mylist-subscribe at my-domain.com.ua    mylist-subscribe at my-domain.com.ua
> mylist-unsubscribe at my-domain.com.ua  mylist-unsubscribe at my-domain.com.ua
> # STANZA END: mylist
> </code>
> Also I`ve added that to /etc/postfix/aliases, even I think this is not important now.

It makes a difference. Mailman's aliases should be in
/var/lib/mailman/data/aliases(.db) because the owner of the .db file in
which the alias is found determines the user under which Postfix
delivers the mail.

> <code>
> ## /etc/postfix/aliases part
> ## mailman mailing list
> mailman:              "|/usr/lib/mailman/mail/mailman post mailman"
> mailman-admin:        "|/usr/lib/mailman/mail/mailman admin mailman"
> mailman-bounces:      "|/usr/lib/mailman/mail/mailman bounces mailman"
> mailman-confirm:      "|/usr/lib/mailman/mail/mailman confirm mailman"
> mailman-join:         "|/usr/lib/mailman/mail/mailman join mailman"
> mailman-leave:        "|/usr/lib/mailman/mail/mailman leave mailman"
> mailman-owner:        "|/usr/lib/mailman/mail/mailman owner mailman"
> mailman-request:      "|/usr/lib/mailman/mail/mailman request mailman"
> mailman-subscribe:    "|/usr/lib/mailman/mail/mailman subscribe mailman"
> mailman-unsubscribe:  "|/usr/lib/mailman/mail/mailman unsubscribe mailman"
> </code>
> root # echo "test" | mail mylist at my-domain.com.ua
> causes error:
> Dec 16 16:53:30 kserv postfix/qmgr[11704]: 33204999DE: from=<root at mail.my-domain.com.ua>, size=450, nrcpt=1 (queue active)
> Dec 16 16:53:30 kserv postfix/virtual[11714]: 33204999DE: to=<mylist at my-domain.com.ua>, relay=virtual, delay=0.24, delays=0.17/0.01/0/0.07, dsn=5.1.1, status=bounced (unknown user: "mylist at my-domain.com.ua")

Probably because of the incorrect mapping in data/virtual-mailman.

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list