summaryrefslogtreecommitdiff
path: root/README.POSTFIX
blob: 68d9fe1ea8d49a275f971bb9165463bf11408fff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Mailman - The GNU Mailing List Management System
Copyright (C) 2001 by the Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA


INTEGRATING POSTFIX AND MAILMAN

    You can integrate Postfix and Mailman such that when new lists are
    created, or lists are removed, Postfix's alias database will
    automatically be updated.  The following are the steps you need to
    take to make this work.

    In the description below, we assume that you've installed Mailman
    in the default location, i.e. /usr/local/mailman.  If that's not
    the case, adjust the instructions according to your use of
    configure's --prefix and --with-var-prefix options.

    - Run the genaliases script to initialize your aliases file.

      % cd /usr/local/mailman
      % bin/genaliases

      Make sure that the owner of the data/aliases and data/aliases.db
      file is `mailman' and that the group owner for those files is
      `mailman'.  E.g.:

      % su
      % chown mailman.mailman data/aliases*

    - Hack your Postfix's main.cf file to include $mailman/data/aliases
      (no trailing .db) in the alias_map variable but not alias_database.
      This is because you do not want Postfix's newalias command to modify
      Mailman's aliases.db file, but you do want Postfix to consult
      aliases.db when looking for local addresses.

      You want to be sure that that you're using the hash: style database
      for this entry.  Here's an example:

      alias_maps = hash:/etc/postfix/aliases,
          hash:/usr/local/mailman/data/aliases

    - When you configure Mailman, use the --with-mail-gid=mailman
      switch.  Because the owner of the aliases.db file is `mailman',
      Postfix will execute Mailman's wrapper program as uid and gid
      mailman.  If you don't use the --with-mail-gid switch, the
      wrapper will bounce messages, complaining of a gid mismatch.

    - Add this to Mailman's mm_cfg.py file:

      MTA = 'Postfix'

      The MTA variable names a module in Mailman/MTA which contains the
      MTA-specific functions to be executed when a list is created or
      removed.

    That's it!  One caveat: when you add or remove a list, the
    aliases.db file will be modified by Mailman, but it will not
    automatically run "postfix reload".  This is because you need to
    be root to run this and suid-root scripts are not secure.  The
    only effect of this is that it will take about a minute for
    Postfix to notice the change to the aliases.db file and update its
    tables.  I consider this a minor inconvenience.
  

AN ALTERNATIVE APPROACH

    Fil <fil@rezo.net> has an alternative approach based on virtual
    maps and regular expressions, as described at:

    (French)  http://listes.rezo.net/comment.php
    (English) http://listes.rezo.net/how.php



Local Variables:
mode: text
indent-tabs-mode: nil
End: