At the end of a meeting, I was only a contact point/person (the guy responsible for X, the guy to be questioned/queried regarding X) for setting up a mail system and mailing lists on the server. But slowly, I ended up being the guy who should set it up. And for a guy, who has only used mailman from the user end and didn't even know what Postfix meant, setting up Postfix and mailman for two different domains, is a challenge (if not anything, more). I struggled quite a bit with it, but finally managed a bare-bones system.
A simple Goo(gle)-search does throw up a hazaar blog posts and how-tos on how to get it done. And that probably is the trouble ;). Hundreds of posts on doing it for a single domain and a handful for doing it for Multiple domains. But, I didn't really find anything comprehensive, if I can say so. This post is a pretty comprehensive on on how to setup Postfix for a single domain (on Debian). I first followed this and got a working Postfix MTA. Then, I set-up a virtual domain on Postfix. The README has it all.
I only had to make a few changes, to add the virtual domain. You just need to add the virtual_alias_domains and add virtual_alias_maps. Here is a glimpse of how our main.cf looks:
myhostname = mail.abc.in
mydomain = abc.in
mydestination = $myhostname, $mydomain, localhost.$mydomain
myorigin = /etc/mailname
virtual_alias_maps =
hash:/etc/postfix/virtual-xyz,
hash:/etc/postfix/virtual-abc,
hash:/var/lib/mailman/data/virtual-mailman
virtual_alias_domains = xyz.in, mail.xyz.in
virtual-xyz and virtual-abc contain the virtual aliases for each domain. Note that Postfix expects hash files and postmap /etc/postfix/virtual-abc needs to be run, each time the file is changed, to keep the hash file in sync with the text file. Also, postfix reload needs to be run, each time changes are made either to main.cf or master.cf.
And now, Mailman. Well the Installation Manual of Mailman, literally has it all. Here is a look at how our mm_cfg.py looks:
DEFAULT_EMAIL_HOST = 'abc.in'
DEFAULT_URL_HOST = 'mail.abc.in'
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
POSTFIX_STYLE_VIRTUAL_DOMAINS=['xyz.in']
add_virtualhost('mail.xyz.in', 'xyz.in')
MTA='Postfix'
Sweet and simple. But, we wanted to run lists with the same names on both the domains. This apparently isn't easy (and I didn't get this working). I experimented with multiple mailman instances but that didn't work, because Postfix (the MTA) can't differentiate between the two instances of mailman. The alternative is "probably" to have two instances of Postfix running too. But, that I felt, was like going too far. I settled with one mailman instance and different list names on each of the domains.
All this is pretty straight forward, right? But since I knew nought about MTAs and mailing lists, it took me quite sometime to get all this in place.
[Well, thanks to Shantanu and Vattam for the inputs; and all the people who cared enough to document their experiences with Mailman and Postfix]