Differences between revisions 9 and 10
Revision 9 as of 2011-11-16 03:51:09
Size: 4174
Editor: drewf
Comment: Underscores appeared not to render but it was an issue with Chrome
Revision 10 as of 2011-11-16 03:51:10
Size: 4114
Editor: drewf
Comment: Migrated to Confluence 4.0
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma page-filename DOC/versions/14352752
This instruction set is written for those who wish to integrate Mailman with the postfix MTA.  The [[http://www.list.org/mailman-install/node12.html|documentation currently available]] does not cover in detail how to use virtual hosts and MySQL-based aliases.
#pragma page-filename DOC/versions/15564802
This instruction set is written for those who wish to integrate Mailman with the postfix MTA.  The [[http://www.list.org/mailman-install/node12.html|documentation currently available]] does not cover in detail how to use virtual hosts and MySQL-based aliases.
Line 4: Line 4:
'''Please note:''' The instructions here are based on the Ubuntu 10.10 Linux distribution, loaded on a VPS.  Specific file locations may differ. '''Please note:''' The instructions here are based on the Ubuntu 10.10 Linux distribution, loaded on a VPS.  Specific file locations may differ.
Line 6: Line 6:
'''Before beginning,''' postfix should be installed and working correctly.  If you are using or plan to use virtual hosts, set this up prior to installing and configuring Mailman. '''Before beginning,''' postfix should be installed and working correctly.  If you are using or plan to use virtual hosts, set this up prior to installing and configuring Mailman.
Line 8: Line 8:
    * h2. Normal postfix Integration
==
Normal postfix Integration ==
Line 11: Line 13:
 1. Add this to the bottom of the $prefix/Mailman/mm_cfg.py file:
{{{
MTA = 'Postfix'
}}}
 1. Add this to the bottom of the $prefix/Mailman/mm_cfg.py file:
 {{{MTA = 'Postfix'}}} Please note that depending on your specific distribution, this setting may be set within $prefix/Mailman/Defaults.py.
 1. Run the following command to initialize your mailman aliases:
 {{{$prefix/bin/genaliases}}} The command creates two files: aliases and aliases.db. These files ''are usually'' created within $prefix/data, but may be located elsewhere, depending on your configuration. They may sometimes be found within /var/lib/mailman/data.
 1. Make sure that the owner and group owner of these files are set to mailman
Line 16: Line 19:
Please note that depending on your specific distribution, this setting may be set within $prefix/Mailman/Defaults.py. == postfix with Virtual Domains (hash map) ==
Line 18: Line 21:
 1. Run the following command to initialize your mailman aliases:
{{{
$prefix/bin/genaliases
}}}
Let's assume you have several domains (in this case '''example1.com''' and '''example2.net''') and you plan on hosting mailman on '''lists.example1.com''' and '''lists.example2.net'''.  You will have to select a default domain you want to host mailman on.  It doesn't really matter which one you choose but remember that it will be the one where everyone will come to administer their lists.  In this case, I will select lists.example1.com
Line 23: Line 23:
The command creates two files: aliases and aliases.db. These files ''are usually'' created within $prefix/data, but may be located elsewhere, depending on your configuration. They may sometimes be found within /var/lib/mailman/data.

 1. Make sure that the owner and group owner of these files are set to mailman
== postfix with Virtual Domains (hash map) ==
Let's assume you have several domains (in this case '''example1.com''' and '''example2.net''') and you plan on hosting mailman on '''lists.example1.com''' and '''lists.example2.net'''.  You will have to select a default domain you want to host mailman on.  It doesn't really matter which one you choose but remember that it will be the one where everyone will come to administer their lists.  In this case, I will select lists.example1.com

 1. Within $prefix/Mailman/mmcfg.py file, add the following lines below the MTA line you inserted above:
{{{
 1. Within $prefix/Mailman/mmcfg.py file, add the following lines below the MTA line you inserted above:
 {{{
Line 32: Line 26:
VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'localhost'
}}}


1. Change '''DEFAULT_EMAIL_HOST''' and '''DEFAULT_URL_HOST''' to match your default domain:
{{{
                                                              * # Default domain for email addresses of newly created MLs
VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'localhost'}}}
 1. Change '''DEFAULT_EMAIL_HOST''' and '''DEFAULT_URL_HOST''' to match your default domain:   {{{
#-------------------------------------------------------------
#
Default domain for email addresses of newly created MLs
Line 40: Line 32:

                                                              * # Default host for web interface of newly created MLs
DEFAULT_URL_HOST = 'lists.mikesoh.com'
}}}

#-------------------------------------------------------------
# Default host for web interface of newly created MLs
DEFAULT_URL_HOST = 'lists.mikesoh.com'}}}
Line 47: Line 36:
 1. Next, modify your postfix configuration to include mailman aliases.  Within main.cf, add the resulting alias files:
{{{
 1. Next, modify your postfix configuration to include mailman aliases.  Within main.cf, add the resulting alias files: 
 {{{
Line 51: Line 40:
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
}}}


1. Save and close main.cf.  Open the master.cf file.  If not already included, add the mailman service to the end of the file:
{{{
 1. ==========================================================================
 1.
service type private unpriv chroot wakeup maxproc command + args
 1. (yes) (yes) (yes) (never) (100)
 1. ==========================================================================
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases}}}
 1. Save and close main.cf. Open the master.cf file. If not already included, add the mailman service to the end of the file:   {{{
# ==========================================================================
#
service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
Line 63: Line 49:
  ${nexthop} ${user}
}}}


1. Save and close master.cf.  Open your transport file.  By default, this file should be located within the same directory as your main.cf and master.cf files.  Add the following lines:
{{{
  ${nexthop} ${user}}}}
 1. Save and close master.cf. Open your transport file. By default, this file should be located within the same directory as your main.cf and master.cf files. Add the following lines: 
 {{{
Line 70: Line 53:
example2.net mailman:
}}}

example2.net mailman:}}}
Line 76: Line 56:
You will not be able to create lists using the web interface.  New lists must use the $prefix/bin/newlist command.
You will not be able to create lists using the web interface. New lists must use the $prefix/bin/newlist command.

This instruction set is written for those who wish to integrate Mailman with the postfix MTA.  The documentation currently available does not cover in detail how to use virtual hosts and MySQL-based aliases.

Please note: The instructions here are based on the Ubuntu 10.10 Linux distribution, loaded on a VPS.  Specific file locations may differ.

Before beginning, postfix should be installed and working correctly.  If you are using or plan to use virtual hosts, set this up prior to installing and configuring Mailman.

Normal postfix Integration

If you do not have any subdomains or do not plan on using virtual hosts within postfix, follow the steps below to integrate Mailman with your system.

  1. Add this to the bottom of the $prefix/Mailman/mm_cfg.py file:

    MTA = 'Postfix' Please note that depending on your specific distribution, this setting may be set within $prefix/Mailman/Defaults.py.

  2. Run the following command to initialize your mailman aliases:

    $prefix/bin/genaliases The command creates two files: aliases and aliases.db. These files are usually created within $prefix/data, but may be located elsewhere, depending on your configuration. They may sometimes be found within /var/lib/mailman/data.

  3. Make sure that the owner and group owner of these files are set to mailman

postfix with Virtual Domains (hash map)

Let's assume you have several domains (in this case example1.com and example2.net) and you plan on hosting mailman on lists.example1.com and lists.example2.net.  You will have to select a default domain you want to host mailman on.  It doesn't really matter which one you choose but remember that it will be the one where everyone will come to administer their lists.  In this case, I will select lists.example1.com

  1. Within $prefix/Mailman/mmcfg.py file, add the following lines below the MTA line you inserted above:
    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['example1.com', 'example2.net']
    VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'localhost'
  2. Change DEFAULT_EMAIL_HOST and DEFAULT_URL_HOST to match your default domain:

    #-------------------------------------------------------------
    # Default domain for email addresses of newly created MLs
    DEFAULT_EMAIL_HOST = 'lists.mikesoh.com'
    #-------------------------------------------------------------
    # Default host for web interface of newly created MLs
    DEFAULT_URL_HOST   = 'lists.mikesoh.com'
  3. Save and close mmcfg.py and run $prefix/bin/genaliases, taking care to make sure that the resulting alias files are readable by postfix.
  4. Next, modify your postfix configuration to include mailman aliases.  Within main.cf, add the resulting alias files:
    virtual_alias_maps = mysql:/etc/postfix/virtual/existing_aliases.cf,
             hash:/var/lib/mailman/data/virtual-mailman
    alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
  5. Save and close main.cf. Open the master.cf file. If not already included, add the mailman service to the end of the file:
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    # ==========================================================================
    mailman   unix  -       n       n       -       -       pipe
      flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
      ${nexthop} ${user
    }
  6. Save and close master.cf. Open your transport file. By default, this file should be located within the same directory as your main.cf and master.cf files. Add the following lines:
    example1.com   mailman:
    example2.net   mailman:
  7. Run postmap -v on the transport file.
  8. Restart mailman and postfix

You will not be able to create lists using the web interface. New lists must use the $prefix/bin/newlist command.


Comments

Mark Sapiro

I do not recommend people follow this article. I do not recommend postfix_to_mailman.py which is a 3rd party module neither distributed nor officially supported by the GNU Mailman project. I also don't understand what is lacking in the official installation manual ("the documentation currently available" link at the beginning of this article, and I don't understand why there would be anything in even these instructions that would prevent them working with lists created via the web interface as long as the permissions are correct on Mailman's data/aliases and data/virtual-mailman files which aren't even used by postfix_to_mailman.py anyway.

MailmanWiki: DOC/Integrating Mailman with postfix (last edited 2014-07-21 18:55:48 by msapiro)