Mailman + Postfix + Virtual Maps = initial mailman list works but new lists don't
![](https://secure.gravatar.com/avatar/8f258d93f417c02bcd91df0c689af15f.jpg?s=120&d=mm&r=g)
*in short: *i can get mailman to work with the 'mailman' list but not with subsequently added lists. * disclaimer:* I've searched long and hard for an answer to this, including the archives of this mailing list. There were similar threads but none of the solutions solved this problem including: http://www.mail-archive.com/mailman-users@python.org/msg55226.html and http://www.mail-archive.com/mailman-users%40python.org/msg55226.html and http://www.mail-archive.com/mailman-users%40python.org/msg54930.html
*versions:* ubuntu 9.04 mailman 2.1.12 postfix 2.5.5
*what works:* postfix virtual domains with mysql work fine. mailman with apache works fine. i'm able to create new lists and the alias and virtual-mailman files are updated. I receive the proper "you've been added" emails. the initial mailman@mydomain.org list and email works. i am able to send and receive email and add new users.
*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@mydomain.org, fail.
*the logs:* here is what the mail.log file says for emails that fail to pleasework@mydomain.org:
May 29 20:13:44 servername postfix/virtual[12598]: 4936C5CB9F: to=< pleasework@mydomain.org>, relay=virtual, delay=888, delays=888/0.05/0/0.01, dsn=4.1.1, status=SOFTBOUNCE (unknown user: "pleasework@mydomain.org")
here is a successful log message to mailmain@mydomain.org:
May 30 16:15:15 servername postfix/pipe[31452]: 51F265CBCB: to=< mailman@lists.mydomain.org>, orig_to=<mailman@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)
*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 well:
# LOOP ADDRESSES START mailman-loop@mydomain.org mailman-loop # LOOP ADDRESSES END
# STANZA START: awesome # CREATED: Sun May 30 17:25:53 2010 pleasework@mydomain.org pleasework
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. 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.
*my setup:*
mm_cfg.py file: MAILMAN_SITE_LIST = 'mailman' DEFAULT_URL_PATTERN = 'http://%s/mailman/' PRIVATE_ARCHIVE_URL = '/cgi-bin/mailman/private' IMAGE_LOGOS = '/images/mailman/' DEFAULT_EMAIL_HOST = 'mydomain.org' DEB_LISTMASTER = 'listmaster@mydomain.org' DEFAULT_URL_HOST = 'lists.mydomain.org' add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) add_virtualhost('lists.mediamobilizingproject.org', ' lists.mediamobilizingproject.org') DEFAULT_SERVER_LANGUAGE = 'en' USE_ENVELOPE_SENDER = 0 DEFAULT_SEND_REMINDERS = 0
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 = 127.0.0.0/8 [::ffff:127.0.0.0]/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, hash:/var/lib/mailman/data/virtual-mailman 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
Thanks for any assistance you can offer!
best,
-Aaron
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
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@mydomain.org, fail.
*the logs:* here is what the mail.log file says for emails that fail to pleasework@mydomain.org:
May 29 20:13:44 servername postfix/virtual[12598]: 4936C5CB9F: to=< pleasework@mydomain.org>, relay=virtual, delay=888, delays=888/0.05/0/0.01, dsn=4.1.1, status=SOFTBOUNCE (unknown user: "pleasework@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@mydomain.org:
May 30 16:15:15 servername postfix/pipe[31452]: 51F265CBCB: to=< mailman@lists.mydomain.org>, orig_to=<mailman@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@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 PRIVATE_ARCHIVE_URL setting.
IMAGE_LOGOS = '/images/mailman/' DEFAULT_EMAIL_HOST = 'mydomain.org' DEB_LISTMASTER = 'listmaster@mydomain.org' DEFAULT_URL_HOST = 'lists.mydomain.org' add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) add_virtualhost('lists.mediamobilizingproject.org', ' lists.mediamobilizingproject.org') DEFAULT_SERVER_LANGUAGE = 'en' USE_ENVELOPE_SENDER = 0 DEFAULT_SEND_REMINDERS = 0
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 = 127.0.0.0/8 [::ffff:127.0.0.0]/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, hash:/var/lib/mailman/data/virtual-mailman 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@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/6081b12a83160157d4f90ef9eb1214c8.jpg?s=120&d=mm&r=g)
hi Mark:
thanks so much for your quick and careful reply. i'm looking forward to trying to work with your suggestions next weekend.
-AC
On Sun, May 30, 2010 at 4:36 PM, Mark Sapiro <mark@msapiro.net> wrote:
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@mydomain.org, fail.
*the logs:* here is what the mail.log file says for emails that fail to pleasework@mydomain.org:
May 29 20:13:44 servername postfix/virtual[12598]: 4936C5CB9F: to=< pleasework@mydomain.org>, relay=virtual, delay=888, delays=888/0.05/0/0.01, dsn=4.1.1, status=SOFTBOUNCE (unknown user: "pleasework@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@mydomain.org:
May 30 16:15:15 servername postfix/pipe[31452]: 51F265CBCB: to=< mailman@lists.mydomain.org>, orig_to=<mailman@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@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 PRIVATE_ARCHIVE_URL setting.
IMAGE_LOGOS = '/images/mailman/' DEFAULT_EMAIL_HOST = 'mydomain.org' DEB_LISTMASTER = 'listmaster@mydomain.org' DEFAULT_URL_HOST = 'lists.mydomain.org' add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) add_virtualhost('lists.mediamobilizingproject.org', ' lists.mediamobilizingproject.org') DEFAULT_SERVER_LANGUAGE = 'en' USE_ENVELOPE_SENDER = 0 DEFAULT_SEND_REMINDERS = 0
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 = 127.0.0.0/8 [::ffff:127.0.0.0]/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, hash:/var/lib/mailman/data/virtual-mailman 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@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Aaron Couch
-
Aaron Couch
-
Mark Sapiro