[Mailman-Users] Changing host names, revisited... POSTFIX_STYLE_VIRTUAL_DOMAINS?

Mark Sapiro mark at msapiro.net
Tue May 4 00:24:19 CEST 2010

On 5/3/2010 2:05 PM, Tanstaafl wrote:
> On 2010-05-03 12:32 PM, Mark Sapiro wrote:
>> [...]
>>> mydomain = example.com
>> And this says that example.com is the local domain
> Hmmm... the postfix docs do not say that this setting equates to a LOCAL
> domain...
>> and it is included by default in mydestination
> Not according to the docs:

You're right. I confused myself because in my Postfix installation,
mydomain and myhostname have the same value.

> Hmmm... well, deliveries to normal email addresses @example.com
> definitely have always used postfix/virtual:
> May  3 13:48:25 myhost postfix/smtpd[24359]: connect from
> hostname.inboundrelay.com[###.###.###.###]
> May  3 13:48:25 myhost postfix/smtpd[24359]: EF3DB650B4F:
> client=hostname.inboundrelay.com[###.###.###.###]
> May  3 13:48:26 myhost postfix/cleanup[24236]: EF3DB650B4F:
> message-id=<4BDF0E0A.7010908 at inboundhost.inbounddomain.com>
> May  3 13:48:26 myhost postfix/qmgr[3930]: EF3DB650B4F:
> from=<external_user at smtp.example2.com>, size=42218, nrcpt=1 (queue active)
> May  3 13:48:26 myhost postfix/virtual[24368]: EF3DB650B4F:
> to=<valid_user at example.com>, relay=virtual, delay=0.68,
> delays=0.67/0/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
> May  3 13:48:26 myhost postfix/qmgr[3930]: EF3DB650B4F: removed
> May  3 13:48:26 myhost postfix/smtpd[24359]: disconnect from
> hostname.inboundrelay.com[###.###.###.###]


> But, you are right, messages to any of the *list* addresses are
> definitely handled by postfix/local (I just must have never noticed),
> and there is something unexpected (see below log sample)...

See comments below.

>> [...]
>>> virtual_alias_maps = mysql:/etc/postfix/mysql_vam.cf,
>>> hash:/var/lib/mailman/data/virtual-mailman
>> And this references Mailman's virtual maps created for the
>> myhost.example.com domain. Normally, for delivery of mail addressed
>> to, e.g. listname-owner at myhost.example.com via the virtual mapping
>> which maps that address to the local address listname-owner, you also
>> need
>> virtual_alias_domains = myhost.example.com
> Nope... these return nothing:
> myhost # ~ postmap -q myhost.example.com mysql:/etc/postfix/mysql_vmd.cf
> myhost # ~ postmap -q smtp.example.com mysql:/etc/postfix/mysql_vmd.cf
> This returns 'Primary Domain' (description in postfixadmin db):
> myhost # ~ postmap -q example.com mysql:/etc/postfix/mysql_vmd.cf

So it appears that example.com is a virtual_mailbox_domain. So what's in
virtual_mailbox_maps (mysql:/etc/postfix/mysql_vmm.cf)? Does

postmap -s mysql:/etc/postfix/mysql_vmm.cf


>> If it is working without that, there might be something in the
>> mysql:/etc/postfix/mysql_vam.cf that is enabling it,
> user = myuser
> password = mypassword
> hosts = localhost
> dbname = mydb
> query = SELECT goto FROM alias WHERE address='%s'
>> or those addresses may not be working,
> By those addresses, you mean valid_user at example.com? Been working for
> over 4 years like this...

No. I mean addresses like list-owner at myhost.example.com.

>> but if they are not, bounce processing and some owner notifications
>> may not be working,
> I do get messages to listname-owner, as well as bounce notifications...
> Something that might help shed some more light though... now that I know
> that list deliveries are handled by postfix/local and regular email
> addresses by postfix/virtual, I looked more closely at the logs...
> Here is a snippet of a list message - note the line where my servers
> name (myhost) is appended:
> 13:17:44 myhost postfix/smtpd[24018]: connect from
> my.workstation.example.com[###.###.###.###]
> May  3 13:17:44 myhost postfix/smtpd[24018]: 45FC66B690E:
> client=my.workstation.example.com[###.###.###.###], sasl_method=PLAIN,
> sasl_username=me at example.com
> May  3 13:17:44 myhost postfix/cleanup[24025]: 45FC66B690E:
> message-id=<4BDF0537.6030405 at example.com>
> May  3 13:17:44 myhost postfix/qmgr[3930]: 45FC66B690E:
> from=<me at example.com>, size=850, nrcpt=1 (queue active)
> May  3 13:17:44 myhost postfix/smtpd[24018]: disconnect from
> my.workstation.example.com[###.###.###.###]
> May  3 13:17:44 myhost imapd-ssl: DISCONNECTED, user=me at example.com,
> ip=[::ffff:###.###.###.###], headers=2144, body=5670, rcvd=1702,
> sent=56680, time=1908, starttls=1
> May  3 13:17:44 myhost postfix/local[24039]: 45FC66B690E:
> to=<listname at smtp.example.com>, orig_to=<ListName at Example.com>,
> relay=local, delay=0.64, delays=0.02/0.04/0/0.58, dsn=2.0.0, status=sent
> (delivered to command: /usr/lib64/mailman/mail/mailman post listname)

Apparently, smtp.example.com is myhostname which is in mydestinations by
default, but now I am puzzled. What is it in your Postfix that maps
ListName at Example.com to local 'listname'? There must be something. This
is the strange part - why is listname at example.com mapped to local
listname but non-listname-user at example.com is mapped to a virtual
mailbox maildir?

> May  3 13:17:44 myhost postfix/qmgr[3930]: 45FC66B690E: removed
> May  3 13:17:46 myhost postfix/smtpd[24020]: connect from
> localhost[]
> May  3 13:17:46 myhost postfix/smtpd[24020]: 265E36285BC:
> client=localhost[]
> May  3 13:17:46 myhost postfix/cleanup[24025]: 265E36285BC:
> message-id=<4BDF0537.6030405 at Example.com>
> May  3 13:17:46 myhost postfix/qmgr[3930]: 265E36285BC:
> from=<listname-bounces at myhost.example.com>, size=1334, nrcpt=4 (queue
> active)
>                        ^^^^^^
> NOTE:                  ^^^^^^ where did that come from?

That's what I've been saying all along. The list's host_name is
myhost.example.com, so EVERY mailman generated list related address is

This is part of what is 'wrong' in your current configuration.

>> My understanding is you want the list addresses to be @example.com and
>> only the web host to be lists.example.com.
> Yes... but... I also want example.com to *not* be considered a local
> domain for normal email...

Apparently, that is what's happening now. The question is why?

Note: All mail to Mailman is ultimately delivered according to the pipe
commands in Mailman's aliases file. For this to work, that mail must be
delivered by Postfix local delivery because local is the only delivery
that consults alias_maps.

So you need list addresses to be handled by local and other addresses in
the example.com domain to be handled by virtual. As I said, that is
apparently working now. On way to accomplish this is via transport_maps.
It is possible even to make a script so mailman writes virtual-mailman
maps which are edited into transport mappings that specify the local
transport for those addresses. But you said there's nothing in
transport_maps doing this now.

Find out how the list at example.com addresses are being mapped to local

>> Given that understanding, what you want to end up with in mm_cfg.py is
>> MTA = 'Postfix'
>> DEFAULT_EMAIL_HOST = 'example.com'
>> DEFAULT_URL_HOST = 'lists.example.com'
>> VIRTUAL_HOSTS.clear()
>> with no POSTFIX_STYLE_VIRTUAL_DOMAINS at all, and, you can remove
>> hash:/var/lib/mailman/data/virtual-mailman
>> from Postfix virtual_alias_maps and remove the
>> /var/lib/mailman/data/virtual-mailman* files.
> So:
> 1. Stop postfix
> 2. Stop mailman
> 3. Make the (above) changes to mm_cfg.py
> 4. Run $prefix/bin/withlist -l -a -r fix_url to fix all existing lists
> 5. Run $prefix/bin/genaliases
> 6. Start mailman
> 7. Start postfix

First we have to figure out exactly why Postfix is doing the right thing
with the example.com domain now. Until we know that, we don't know
whether virtual_alias_maps and POSTFIX_STYLE_VIRTUAL_DOMAINS are important.

>> What about web server changes for the lists.example.com vs.
>> myhost.example.com change (there may not be any), and DNS for the
>> lists.example.com domain?
> I've already got the DNS setup... but this question made me realize,
> there isn't any vhost file set up for mailman access, and its been a
> long time since I originally set this up (with some help from someone
> else who apparently only knew a little more than I did - ;) ...
> The current list management pages are at the address:
> https://myhost.example.com/mailman/...
> I looked at /etc/apache2/modules.d/50_mailman.conf, but it doesn't show
> anything about my hostname, so, what controls the root directory?

There is a ScriptAlias for mailman. If it is in a global section of
httpd.conf, it's OK as is. If it is in a VirtualHost block for
myhost.example.com, it will have to be moved/added to a VirtualHost
block for lists.example.com. Likewise for any pipermail Alias and any
Directory blocks relating to Mailman directories.

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