me, thinking out loud…

Well, there are a hazaar tutorials on setting up Postfix and Mailman for Debian for a single domain. There were a few for doing that for multiple domains also, but nothing comprehensive, if I could say so. This link is pretty comprehensive and details all the steps for setting up Postfix for a single domain.
Here is all you’ll want to know about setting up Virtual domains in Postfix.

You only need to make a few changes for adding a second (or more) domain. You just need to add the virtual_alias_domains and add virtual_alias_maps. Here is a glimpse of how my 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 hence you need to run postmap /etc/postfix/virtual-abc each time the file is changed, to keep the hash file in sync with the text file that you edit. Also, you need to run postfix reload, each time you make changes to main.cf or master.cf

Fairly straight forward, right? But it took me quite sometime to get it all right, since this was the first time I was doing anything with Mail Transfer Agents or the like.

Now, onto Mailman. Well the Installation Manual of Mailman, literally has it all. Here is a look at how my 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'

The only trouble was to get mailing lists with same names on both the domains (which I couldn’t get working). I experimented with multiple mailman instances but that won’t work because 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, and gave up. [What if we wanted to add another domain to the list?!]

Also, I had to make a few alterations to the Apache file to allow access to the mailman pages without breaking the Zope redirection that was already set-up.

[Thanks to Shantanu and Vattam (and all the hazaar people using Postfix and Mailman and cared to document things for the sake of others, and of course Google)]

Comments on: "Postfix + Mailman for Multiple Domains." (3)

  1. […] Postfix + Mailman for Multiple Domains. August 2009 3 […]

  2. sputnik said:

    Hello my friend.
    Thanks for the tutorial

    I have followed your instructions.
    How do I make a new mailing list with different domain now?
    When I give this to the shell
    >> newlist
    I get a mailing list with the default domain without the ability to choose for a new one.

    Thanks for your time

  3. Use –urlhost and –emailhost arguments.

    -u urlhost
    –urlhost=urlhost
    Gives the list’s web interface host name.

    -e emailhost
    –emailhost=emailhost
    Gives the list’s email domain name.

    Use –help argument to get more help.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: