[Mailman-Developers] Postfix virtual domains (was Re: MTA interface for MM 2.1)

Barry A. Warsaw barry@zope.com
Fri, 23 Nov 2001 19:00:16 -0500

>>>>> "BAW" == Barry A Warsaw <barry@zope.com> writes:

    BAW> I figured out how to support Postfix-style virtual domains[1]
    BAW> in a similar manner to the main aliases file, but I'm too
    BAW> tired to finish implementing it tonight.

I'm about to check this stuff in, but it's a little kludgy.  I may not
entirely understand Postfix-style virtual domains, so let me ask this:

Let's say I have two domains, er, dom1.com and dom2.com, and MX for
both of these point to the same IP.  It seems to me that I have to
have at least one of them in the mydestinations variable in main.cf.

So let's say I put dom1.com in mydestinations, and I want dom2.com to
be a Postfix-virtual domain, so I set up a virtual_maps file with some
common addresses like postmaster@dom2.com.  To work with Mailman, I'll
also add /usr/local/mailman/data/virtual-dom2.com virtual_maps.  The
.db file will contain the BerkeleyDB mappings equivalent to the
plaintext file .../data/virtual-dom2.com containing stuff like:

-------------------- snip snip --------------------
# This file is generated by Mailman, and is kept in sync with the binary hash
# file virtual-mailman.db.  YOU SHOULD NOT MANUALLY EDIT THIS FILE unless you
# know what you're doing, and can keep the two files properly in sync.  If you
# screw it up, you're on your own.

dom2.com 	IGNORE
# For breaking bounce loops to the site list owners
mailman-loop@dom2.com: mailman-loop

# STANZA START: testlist
# CREATED: Fri Nov 23 18:39:34 2001
testlist@dom2.com:          testlist
testlist-admin@dom2.com:    testlist-admin
testlist-bounces@dom2.com:  testlist-bounces
testlist-join@dom2.com:     testlist-join
testlist-leave@dom2.com:    testlist-leave
testlist-owner@dom2.com:    testlist-owner
testlist-request@dom2.com:  testlist-request
# STANZA END: testlist
-------------------- snip snip --------------------

For convenience, I'll create a pair of these for every domain for
which there are lists (i.e. for every unique mlist.host_name).  Now
the kludges:

If dom1.com is set in mydestinations, then you /should not/ add
data/virtual-dom1.com to virtual_maps, even though bin/genaliases will
create a file for it.  It's too complicated to prevent the writing of
data/virtual-dom1.com, so just ignore it.

It seems like there's no way to prevent sending a message to
list-in-dom2@dom1.com working exactly the same as
list-in-dom2@dom2.com.  This is because list-in-dom2 must have an
entry both in the aliases file and the virtual file (with the virtual
file entries pointing to the aliases entries), and the alias entries
always work for mydestination domains.  Maybe other Postfix experts
can help with this, but to me, it's not worth worrying about.

Anyway, changes coming to Defaults.py.in, Mailman/MTA/Postfix.py and
bin/genaliases.  Comments are welcome!