[Mailman-Users] Mailman + Postfix + Virtual Maps = initial mailmanlist works but new lists don't

Mark Sapiro mark at msapiro.net
Sun May 30 22:36:07 CEST 2010

Aaron Couch wrote:
>*what doesn't work:*
>any lists added after the inital 'mailman' list fails. it is added through
>the web interface and added to the alias and virtual mailman files. the new
>users get the "you've been added email". however any emails sent to that
>list, let's call it pleasework at mydomain.org, fail.
>*the logs:*
>here is what the mail.log file says for emails that fail to
>pleasework at mydomain.org:
>May 29 20:13:44 servername postfix/virtual[12598]: 4936C5CB9F: to=<
>pleasework at mydomain.org>, relay=virtual, delay=888, delays=888/0.05/0/0.01,
>dsn=4.1.1, status=SOFTBOUNCE (unknown user: "pleasework at mydomain.org")

relay=virtual is a problem. It suggests that mydomain.org is a
virtual_mailbox_domain, not a virtual_alias_domain.

>here is a successful log message to mailmain at mydomain.org:
>May 30 16:15:15 servername postfix/pipe[31452]: 51F265CBCB: to=<
>mailman at lists.mydomain.org>, orig_to=<mailman at mydomain.org>, relay=mailman,
>delay=0.66, delays=0.25/0.01/0/0.4, dsn=2.0.0, status=sent (delivered via
>mailman service)

This says the mailman at lists.mydomain.org mail is delivered via the
Debian/Ubuntu postfix_to_mailman.py mailman service. This does not use
aliases or virtual_mailman at all but requires dedicated list domains
such as lists.mydomain.org. I.e. every domain which has Mailman lists
needs an entry like

lists.example.com   mailman:

in /etc/postfix/transport or where ever the Postfix transport_maps are.

This also complicates delivery to any addresses in the domain which
aren't Mailman list addresses.

>*uninformed analysis:*
>it seems like the mailman-virtual map isn't working. i've tried changing the
>permissions in the mailmain-virtual file in case that was an issue but to no
>avail. again the 'pleasework' list does show up in it and the alias file as
>I have had a hickup when trying to regenerate the alias files. The
>bin/genaliases file had the following errors:
>Traceback (most recent call last):
>  File "bin/genaliases", line 116, in <module>
>    main()
>  File "bin/genaliases", line 83, in main
>    modulename = 'Mailman.MTA.' + mm_cfg.MTA
>TypeError: cannot concatenate 'str' and 'NoneType' objects
>In my mm_cfg I had MTA=None which is recommended when using the
>'/usr/share/mailman/postfix-to-mailman.py'. I tried changing it to MTA=""
>but still got an error. It succeeded when I just removed the MTA variable.

MTA = None says mailman doesn't generate aliases at all, thus you
aren't expected to be running bin/genaliases if MTA = None.

I suppose this is a bug in genaliases. It should instead just scold you
for trying to generate aliases when you have configured it not to.

Removing MTA = None from mm_cfg.py allows the default MTA = 'Manual' to
take effect which should cause genaliases to just print the aliases.

How are aliases and virtual-mailman being generated? That requires MTA
= 'Postfix'.

>It says to add the list info to the /etc/aliases file and use the newaliases
>command but in my main.cf file I have the mailman aliases file added to the
>alias_maps variable (see below) so I would think that shouldn't be an issue.

It says that because MTA = 'Manual' (from Defaults.py)

>*my setup:*
>mm_cfg.py file:
>MAILMAN_SITE_LIST = 'mailman'
>DEFAULT_URL_PATTERN = 'http://%s/mailman/'
>PRIVATE_ARCHIVE_URL = '/cgi-bin/mailman/private'

Unless this is some Debian/Ubuntu specific thing, there is no

>IMAGE_LOGOS         = '/images/mailman/'
>DEFAULT_EMAIL_HOST = 'mydomain.org'
>DEB_LISTMASTER = 'listmaster at mydomain.org'
>DEFAULT_URL_HOST   = 'lists.mydomain.org'
>add_virtualhost('lists.mediamobilizingproject.org', '

If you set DEFAULT_EMAIL_HOST = 'lists.mydomain.org' instead of
'mydomain.org' and run

bin/withlist -r fix_url LISTNAME

on those lists which currently have a host_name of 'mydomain.org' and
also make sure you have a

lists.mediamobilizingproject.org   mailman:

entry as well as the

lists.mydomain.org   mailman:

that you currently have in /etc/postfix/transport, then you will be
able to mail to all your lists in the lists.mydomain.org and
lists.mediamobilizingproject.org domains.

If you do this, you should also put

MTA = None

back in mm_cfg.py and remove the hash:/var/lib/mailman/data/aliases and
hash:/var/lib/mailman/data/virtual-mailman from alias_maps and
relay_recipient_maps virtual_alias_maps in Postfix and remove the
data/aliases* and data/virtual-mailman* files.

If you really want lists with an email domain of 'mydomain.org' and not
'lists.mydomain.org' then this becomes much more complicated.

If you need that, you probably have to forget postfix_to_mailman.py and
see the FAQ at <http://wiki.list.org/x/ZoCj>. Note that there is a
note in that FAQ which says

  Also, this whole process may be unnecessary. According to this thread
  on the mailman-users list simply referencing the Mailman generated
  virtual-mailman in virtual_alias_maps in Postfix is sufficient even
  if the domain is a virtual_mailbox_domain.

But your experience seems to say that "simply referencing the Mailman
generated virtual-mailman in virtual_alias_maps in Postfix" is not
sufficient, however this may be because your Postfix relay_domains
does not include mydomain.org, thus your relay_recipient_maps is
probably ignored for that domain.

>postconf -n :
>alias_database = hash:/etc/aliases
>alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
>append_dot_mydomain = no
>biff = no
>broken_sasl_auth_clients = yes
>config_directory = /etc/postfix
>delay_warning_time = 4h
>disable_vrfy_command = yes
>inet_interfaces = all
>mailbox_size_limit = 0
>masquerade_domains = mail.mydomain.org
>masquerade_exceptions = root
>mydestination = mediamoblizing.org, localhost.mydomain.org, , localhost
>myhostname = servername.mydomain.org
>mynetworks = [::ffff:]/104 [::1]/128
>myorigin = mydomain.org
>readme_directory = no
>recipient_delimiter = +
>relay_domains = lists.mydomain.org, lists.mediamobilizingproject.org
>relay_recipient_maps = hash:/var/lib/mailman/data/virtual-mailman
>relayhost =
>smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
>smtp_use_tls = yes
>smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
>smtpd_helo_required = yes
>smtpd_helo_restrictions = permit_mynetworks, reject_invalid_hostname, permit
>smtpd_recipient_restrictions = reject_unknown_sender_domain,
>reject_unknown_recipient_domain, reject_unauth_pipelining,
>permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
>smtpd_sasl_auth_enable = yes
>smtpd_sasl_authenticated_header = yes
>smtpd_sasl_local_domain = $myhostname
>smtpd_sasl_path = private/dovecot-auth
>smtpd_sasl_security_options = noanonymous
>smtpd_sasl_type = dovecot
>smtpd_sender_restrictions = reject_unknown_sender_domain
>smtpd_tls_auth_only = yes
>smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem
>smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key
>smtpd_tls_mandatory_ciphers = medium, high
>smtpd_tls_mandatory_protocols = SSLv3, TLSv1
>smtpd_tls_received_header = yes
>smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
>smtpd_use_tls = yes
>soft_bounce = yes
>tls_random_source = dev:/dev/urandom
>transport_maps = hash:/etc/postfix/transport
>unknown_address_reject_code = 554
>unknown_client_reject_code = 554
>unknown_hostname_reject_code = 554
>virtual_alias_maps = proxy:mysql:/etc/postfix/my_alias_maps.cf,
>virtual_gid_maps = static:8
>virtual_mailbox_base = /var/vmail
>virtual_mailbox_domains = mydomain.org
>virtual_mailbox_maps = proxy:mysql:/etc/postfix/my_mailbox_maps.cf
>virtual_minimum_uid = 150
>virtual_transport = virtual
>virtual_uid_maps = static:150

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