Differences between revisions 7 and 10 (spanning 3 versions)
Revision 7 as of 2012-03-04 07:51:45
Size: 3018
Editor: msapiro
Comment: Replaced [^ ] and [ ] with S and s in sed command to account for tabs.
Revision 10 as of 2014-11-29 23:15:42
Size: 3150
Editor: msapiro
Comment: Edited a link description. Added item about relay_domains.
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma page-filename DOC/versions/14352737
Mailman can be configured to automatically [[http://www.list.org/mailman-install/node13.html|generate list aliases for Postfix]], and this process can also be hijacked to [[DOC/Integrating Mailman with Sendmail - Method 2|generate aliases automatically for sendmail]].
#pragma page-filename DOC/versions/10715238
Mailman can be configured to automatically [[http://www.list.org/mailman-install/node13.html|generate list aliases for Postfix]], and this process can also be hijacked to [[../Integrating Mailman with Sendmail - Method 2|generate aliases automatically for sendmail]].
Line 4: Line 4:
Mailman can also be additionally configured to automatically [[http://www.list.org/mailman-install/postfix-virtual.html|generate virtual alias mappings for postfix]]. Mailman can also be additionally configured to automatically
[[http://www.list.org/mailman-install/postfix-virtual.html|generate virtual alias mappings for postfix]].
Line 9: Line 10:
Line 10: Line 12:
Line 14: Line 15:
Line 17: Line 17:
 1. Create /path/to/data/virtual_to_transport with the following content
{{{
 1.  Create /path/to/data/virtual_to_transport with the following content
 {{{
Line 20: Line 20:
sed -r -e 's/(^[^#]\S+\s+).+$/\1local/' $1 \ sed -r -e 's/(^[^#]\S+\s+).+$/\1local:/' $1 \
Line 24: Line 24:
 {{{#!wiki caution
Line 25: Line 26:

{{{#!wiki caution
Line 28: Line 27:
Line 31: Line 29:


1. Then
{{{
 1.  Then
 {{{
Line 38: Line 34:

If your Mailman group is not 'mailman', put the actual group in the chgrp command.

1. Put
{{{
 If your Mailman group is not 'mailman', put the actual group in the chgrp command.
 1.  Put
 {{{
Line 45: Line 39:

in mm_cfg.py

1. Run Mailman's bin/genaliases. This will create/update the following files in /path/to/data/:
. aliases
. aliases.db
.
virtual-mailman
. transport-mailman
. transport-mailman.db
Make sure transport-mailman and transport-mailman.db have permissions like aliases and aliases.db. In particular, transport-mailman.db must be readable by Postfix. From now on, these files will be maintained automatically by Mailman as lists are created and deleted.
 in mm_cfg.py
 1. Run Mailman's bin/genaliases. This will create/update the following files in /path/to/data/:<<BR>> . aliases<<BR>> . aliases.db<<BR>> . virtual-mailman<<BR>> . transport-mailman<<BR>> . transport-mailman.db<<BR>> Make sure transport-mailman and transport-mailman.db have permissions like aliases and aliases.db. In particular, transport-mailman.db must be readable by Postfix. From now on, these files will be maintained automatically by Mailman as lists are created and deleted.
Line 57: Line 42:
 1. Depending on your exact use case, it may be necessary to add the list domain(s) to relay_domains in main.cf.

Mailman can be configured to automatically generate list aliases for Postfix, and this process can also be hijacked to generate aliases automatically for sendmail.

Mailman can also be additionally configured to automatically generate virtual alias mappings for postfix.

Some people find these features insufficient as they want to use some specific transport or other mapping for Mailman list addresses that is not applied to all addresses in the list domain(s). The following is a way to automate the generation of some Postfix map via editing the Mailman generated virtual-mailman file.

The following is not necessary if all that is desired is to have Mailman lists in a virtual_mailbox_domain. See this thread and this post on the mailman-users list and this example. However, the following or a similar procedure may still be useful to automatically generate transport_maps or some other mapping for Mailman lists for other purposes.

  1. Put the list domain(s) in POSTFIX_STYLE_VIRTUAL_DOMAINS in mm_cfg.py just as if they were going to be virtual_alias_domains.
  2. Do not put the domains in Postfix virtual_alias_domains, and do not put hash:/path/to/data/virtual_mailman in virtual_alias_maps.
  3. Create /path/to/data/virtual_to_transport with the following content
    sed -r -e 's/(^[^#]\S+\s+).+$/\1local:/' $1 \
     > /path/to/data/transport-mailman
    /usr/sbin/postmap /path/to/data/transport-mailman

    Some non-GNU versions of sed require -E instead of -r to indicate extended regexps. Also, you can specify a transport other than 'local' by substituting its name for 'local' in the sed command above.

  4. Then
    chgrp mailman /path/to/data/virtual_to_transport
    chmod 750 /path/to/data/virtual_to_transport
    If your Mailman group is not 'mailman', put the actual group in the chgrp command.
  5. Put
    POSTFIX_MAP_CMD = '/path/to/data/virtual_to_transport'
    in mm_cfg.py
  6. Run Mailman's bin/genaliases. This will create/update the following files in /path/to/data/:
    . aliases
    . aliases.db
    . virtual-mailman
    . transport-mailman
    . transport-mailman.db
    Make sure transport-mailman and transport-mailman.db have permissions like aliases and aliases.db. In particular, transport-mailman.db must be readable by Postfix. From now on, these files will be maintained automatically by Mailman as lists are created and deleted.

  7. Add "hash:/path/to/data/transport-mailman" to transport_maps in main.cf.
  8. Depending on your exact use case, it may be necessary to add the list domain(s) to relay_domains in main.cf.
  9. Reload Postfix to pick up the main.cf changes.

MailmanWiki: DOC/Mailman - Postfix integration with Mailman generated transport or other maps (last edited 2016-02-11 16:20:52 by msapiro)