Mac OS X Server v10.6: Configuring the Mail service so Mailman can support virtual domains

Follow these steps to configure Mail service's mailing list to utilize postfix-style virtual domains.

This article has been archived and is no longer updated by Apple.
  1. Stop the Mail Server in Server Admin.
  2. In the Mail service, navigate to Settings > Advanced > Hosting. 
  3. Enable virtual hosts, then add your virtual hosts.
  4. Click the Mailing Lists tab.
  5. Select the checkbox next to "Enable mailman mailing lists".
  6. Modify the Postfix configuration file by adding the path to the variable virtual_alias_maps to point to the virtual-mailman file. To do this, open Terminal and use this command to view the current setting:
    sudo /usr/sbin/postconf virtual_alias_maps
    You should receive output such as this:
    virtual_alias_maps = hash:/etc/postfix/virtual_users
     
  7. Add the path to the virtual-mailman file with this command:
    sudo /usr/sbin/postconf -e virtual_alias_maps='hash:/etc/postfix/virtual_users, hash:/var/mailman/data/virtual-mailman'
     
  8. Open /usr/share/mailman/Mailman/mm_cfg.py in a text editor.
  9. Add the POSTFIX_STYLE_VIRTUAL_DOMAINS variable to the list of virtual domains that Mailman should update.  For example, if adding virtual domains virtual1.dom and virtual2.dom, The Mailman configuration file mm_cfg.py would look something like this:
        ##################################################
        # Put your site-specific settings below this line.
        MTA = 'Postfix'
        DEFAULT_EMAIL_HOST = '<your_host>'
        DEFAULT_URL_HOST = '<your_host>'
        POSTFIX_STYLE_VIRTUAL_DOMAINS = [ 'virtual1.dom', 'virtual2.dom', ] 
    
  10. Once the configurations are complete, create the mailing lists with the virtual domains.  Use the Mailman newlist tool with the -e option to assign the virtual domain.  Enter the list administrator’s email address and initial list password:
    sudo /usr/share/mailman/bin/newlist –e 'virtual1.dom' my-list
    Enter the email of the person running the list: list-admin@virtual1.dom
    Initial my-list password:  password
    Press Return to notify my-list owner...

    Note:  At the end you press Return to create the list.  Make sure that the host name used for the –e option is one you configured in the POSTFIX_STYLE_VIRTUAL_DOMAINS variable.
     
  11. Verify that the virtual-mailman and virtual-mailman.db files were created in /var/mailman/data/ with this command:
    ls -la /var/mailman/data/
    The output should be similar to this:

    -rw-r--r--   1 _mailman  _mailman  14114 Dec 22  2008 sitelist.cfg
    -rw-rw----   1 _mailman  _mailman   2293 Jun 30 15:07 virtual-mailman
    -rw-rw-r--   1 _mailman  _mailman  16384 Jun 30 15:07 virtual-mailman.db
  12. If the permissions are not as shown in the output above, change the ownership and permissions with these commands:
    sudo chown _mailman:_mailman /var/mailman/data/virtual-mailman*
    sudo chmod 660 /var/mailman/data/virtual-mailman
    sudo chmod 664 /var/mailman/data/virtual-mailman.db
    
     
  13. Once you are finished adding virtual domains you can now start the mail server.

    Note:  You must add the POSTFIX_STYLE_VIRTUAL_DOMAINS variable to the mm_cfg.py prior to creating any virtual mailing lists.

If you disable “virtual hosting” from Server Admin, it will remove the path to the virtual-mailman file from the virtual_alias_maps variable and will need to be manually added again if you re-enable “virtual hosting”.

Published Date: