Mailman and virtual mailhosting (postfix)
Hello!
After several researches with Google and archives of mailinglists please allow me to contact you via this mailinglist.
Our postfix-mailserver hosts several domains (virtual mailhosting, postfix/mysql) and "mailman".
The "primary domain" myserver.de is a virtualized domain also. So this domain is not listed in mydestination: --> myhostname = mail.myserver.de mydomain = myserver.de myorigin = $mydomain
mydestination = $myhostname, localhost <--
As far as I understand mailman forwards all emails to the "primary domain" (mydomain) and mailman is only working if I add $mydomain to mydestination.
But when doing this there are warnings from postfix that it is not allowed to list the domain in the virtual aliases (mysql-database) and in relay_domains.
Is there any possiblity to configure mailman to forward the emails in ./data/virtual-mailman not to "testliste2@myserver.de" but to "testliste2@mail.myserver.de"?
My actual config is: --> DEFAULT_EMAIL_HOST = 'mail.myserver.de' DEFAULT_URL_HOST = 'lists.myserver.de' DEFAULT_URL_PATTERN = 'http://%s/mailman/'
MTA = 'Postfix' POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.myserver.de'] add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) <--
Or am I missing an important point?
Kind regards,
Jens
Jens Meyer wrote:
This is the assumption of Mailman/Postfix integration.
I don't understand your configuration. The above Mailman config items say that lists.myserver.de is a postfix virtual domain and that Mailman lists whose host_name is lists.myserver.de will get virtual_mailman entries of the form
testliste2@lists.myserver.de testliste2
(i.e. map the virtual domain address 'testliste2@lists.myserver.de' to local name 'testliste2' where it will be handled by the 'testliste2:' entry in aliases). However, your setting of DEFAULT_EMAIL_HOST = 'mail.myserver.de' says lists will be created with a host_name of 'mail.myserver.de', so no virtual_mailman entries will be created at all.
Something is clearly wrong. From your description, I think if you change
POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.myserver.de']
to
POSTFIX_STYLE_VIRTUAL_DOMAINS = ['mail.myserver.de']
And run Mailman's bin/genaliases, you will get what you want. I.e., you will get virtual_mailman with entries like
testliste2@mail.myserver.de testliste2
which will map the virtual domain list address 'testliste2@mail.myserver.de[' to the local name 'testliste2' which will be delivered to Mailman according to the 'testliste2' alias in Mailman's data/aliases.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Dear Mark, hello all!
Thank you very much for your detailed reply to my request from June. Your help is greatly appreciated - but unfortunately I had no time to check this out until now due to work-overload and holidays.
My system accepts mails for listname@lists.myserver.de without problems. The only problem is that I can not use the internal redirection from mailman to listname@myserver.de without (internal) postfix-warnings because the domain myserver.de is used by the virtual mailhosting also (see my last post).
So one solution would be to "ask" mailman to redirect all emails not to listname@myserver.de but to listname@MAIL.myserver.de.
Do you think this is possible or is there another solution for my problem?
Kind regards,
Jens
Mark Sapiro schrieb:
Jens Meyer wrote:
I don't think I understand what you want to do. If you want the Mailman list to 'advertise' itself as listname@MAIL.myserver.de, all you need to do is change the list's host_name attribute on the General Options admin page to mail.myserver.de if it isn't already.
If what you are asking is for Mailman to create virtual alias map entries for Postfix of the form
listname@mail.myserver.de listname ...
You need to set
POSTFIX_STYLE_VIRTUAL_DOMAINS = ['mail.myserver.de']
in mm_cfg.py instead of what you have, and then run Mailman's bin/genaliases to generate Mailman's data/virtual-mailman* files with the appropriate entries. You also need to reference this file in Postfix's virtual_alias_maps.
This is what I tried to say below.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hello Mark,
thank you for your further reply.
The problem are not the virtual hostnames or the "advertisements" of the listnames. My problem is the internal handling:
Is it possible to change Mailman's internal usage (target for internal redirections) from @hostname.com to @mail.hostname.com (because @hostname.com is used for virtual emails on this server actually).
Kind regards,
Jens
Mark Sapiro schrieb:
Jens Meyer wrote:
I do not understand your question. I think you do not understand Mailman's processing.
Internally, Mailman uses only the list name. Mailman doesn't do 'internal redirections'
For incoming mail, the MTA handles mail according to its configuration, but ultimately, for mail destined to Mailman, pipes the mail to Mailman's wrapper to be posted to a list via a pipe like "|/usr/local/mailman/mail/mailman post listname". Only the listname is involved at this point. No domain is involved.
If you want mail to 'listname@hostname.com' to be handled as though it were addressed to 'listname@mail.hostname.com' you have to do that in Postfix, but I don't think that is your issue.
Answer these questions:
How do you want list mail to be addressed? I.e., to list@ what domain?
Is this domain a virtual domain in Postfix?
I think the answers are mail to list@hostname.com (not list@mail.hostnamecom), and yes, hostname.com is a virtual domain in Postfix.
If this is correct, you want something like
DEFAULT_EMAIL_HOST = 'hostname.com' DEFAULT_URL_HOST = 'lists.hostname.com' DEFAULT_URL_PATTERN = 'http://%s/mailman/'
MTA = 'Postfix' POSTFIX_STYLE_VIRTUAL_DOMAINS = ['hostname.com'] add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
in mm_cfg.py, and in your Postfix configuration
alias_maps = ... hash:/path/to/mailman/data/aliases
and
virtual_alias_domains = ... hostname.com
and
virtual_alias_maps = ... hash:/path/to/mailman/data/virtual-mailman
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hello!
Thank you for your patient clarifications!
Yes, I understand: Internally Mailman uses only the listname. And the domainname/hostname.
Perhaps another explanation is helpful (from postfix-side):
To get Mailman working the following configuration is needed actually: myhostname = mail.myserver.de mydomain = myserver.de mydestination = $myhostname, $mydomain, localhost
But I want/need to change this to (working before without problems): myhostname = mail.myserver.de mydomain = myserver.de mydestination = $myhostname, localhost
because $mydomain is used by virtual mailsystem (postfix-warning: "Jul 24 10:32:19 lovejoy postfix/trivial-rewrite[31288]: warning: do not list domain myserver.de in BOTH mydestination and virtual_mailbox_domains").
How can I avoid this warning (without removal of the other email-handling for myserver.de)?
Kind regards,
Jens
Mark Sapiro schrieb:
Jens Meyer wrote:
I'm not certain how to do this because I don't know enough about Postfix.
The normal way to do this with Mailman-Postfix integration is to put the following in mm_cfg.py.
DEFAULT_EMAIL_HOST = 'myserver.de' DEFAULT_URL_HOST = 'lists.myserver.de' MTA = 'Postfix' POSTFIX_STYLE_VIRTUAL_DOMAINS = ['myserver.de'] add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
Then run fix_url to update the list(s). E.g.
bin/withlist -l -r fix_url listname
or
bin/withlist -l -a -r fix_url
for all lists. Or, if DEFAULT_URL_HOST isn't changed from when the lists were created, you can just change the host_name on the list's General Options page to myserver.de.
Then run Mailman's bin/genaliases.
This will create/update two files and their corresponding .db files in Mailman's data/ directory.
aliases(.db) will contain the list aliases of the form
list: "|/path/to/mailman/mail/mailman post list" list-admin: "|/path/to/mailman/mail/mailman admin list" ...
with 10 aliases per list.
virtual-mailman(.db) will contain the virtual domain maps of the form
list@myserver.de list list-admin@myserver.de list-admin ...
with 10 mappings per list.
Then in Postfix's main.cf you would do the following:
add hash:/path/to/mailman/data/aliases to the alias_maps list
add hash:/path/to/mailman/data/virtual-mailman to the virtual_alias_maps list
add myserver.de to the virtual_alias_domains list.
Then, for example, mail to list@myserver.de will be mapped via virtual_alias_maps to the local name 'lists' which is aliased to the pipe to Mailman.
The only problem with this is you already have myserver.de as a virtual_mailbox_domain. This complicates things bcause virtual_mailbox_maps maps to mailbox files or maildir directories, not to local names that can be aliased.
You might be able to make this work with Mailman's maildir delivery option, but you would have to modify Mailman/MTA/Postfix.py to generate the appropriate maps to use with Postfix.
There may be other ways to make this work in Postfix, but these are Postfix questions that I am unable to answer.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Jens Meyer
-
Mark Sapiro