Exim 4.72 release
[exim-website.git] / howto / mailman20.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3   <head>
4     <title>HOWTO - Using exim and Mailman together</title>
5   </head>
6
7   <body bgcolor="#FFFFFF" text="#00005A" link="#FF6600" alink="#FF9933" vlink="#990000">
8     <h1>HOWTO - Using exim and Mailman together</h1>
9
10     <p>Mailman is a list manager with web front end and built in
11       archiving functions.  Details can be found at <a href="http://www.list.org/">http://www.list.org/</a></p>
12
13     <h2>Mailman configuration</h2>
14
15     <p>There is no Mailman configuration needed other than the
16     standard options detailed in the Mailman install documentation.
17     The exim configuration is transparent to Mailman.  The uid/gid
18     settings for Mailman must match those in the config fragments
19     given below.</p>
20
21     <h2>Exim configuration</h2>
22
23     <p>The exim configuration is built so that a list created within
24     Mailman automagically appears to exim without the need for
25     additional alias files etc to be changed.</p>
26
27     <p>The drawback of this configuration is that it will work poorly
28     on systems supporting lists in several different mail domains -
29     for that matter Mailman itself has poor support for this right
30     now. This may change in the future</p>
31
32     <p>The configuration file segments included are to be built on top
33     of an already functional exim configuration, which accepts mail
34     for the domain which the list resides in (ie that domain is
35     already in <tt>local_domains</tt> - should this domain be separate
36     from the others handled by this exim, then add the list domain to
37     <tt>local_domains</tt>, add a <tt>domains=my.list.domain</tt>
38     option to each of the directors and you may wish to exclude that
39     domain from the other directors.</p>
40
41     <p>Your exim configuration also needs a working alias
42     configuration, with entries (within the list domain) for
43     <tt>mailman</tt>, <tt>mailman-request</tt> and
44     <tt>mailman-admin</tt> (plus any other global contact addresses
45     for the list master).  These addresses point to a (or some - not
46     necessarily the same for all of these aliases) human rather than
47     being piped into Mailman. You do <b>not</b> need to put per-list
48     entries into the system alias file, and doing so will most likely
49     break things since the user id used for delivery is likely to be
50     incorrect or not set (which causes an exim delivery time config
51     error).</p>
52
53     <p>There are 3 config file sections below which need pasting into
54     the appropriate parts of the main exim config file.  The first one
55     may also need tailoring to your Mailman configuration</p>
56
57     <h4>Main config file section</h4>
58 <pre>
59 ## Top section of config file - macro definitions
60 ## Tailor these to fit your installation
61 ## pretty much everything else should just fit...
62 ##
63 # home dir for Mailman
64 MAILMAN_HOME=/home/mailman
65 # wrapper script for mailman
66 MAILMAN_WRAP=MAILMAN_HOME/mail/wrapper
67 # user and group for Mailman
68 MAILMAN_UID=exim
69 MAILMAN_GID=exim
70 </pre>
71     <h4>Transports config file section</h4>
72 <pre>
73 ## Transports section
74 ##
75 ## Three transports for list mail, request mail and admin mail
76 ## respectively
77 ## Mailman is installed in MAILMAN_HOME
78 ## Mailman is configured to be invoked as user exim
79 list_transport:
80            driver = pipe
81            command = MAILMAN_WRAP post ${lc:$local_part}
82            current_directory = MAILMAN_HOME
83            home_directory = MAILMAN_HOME
84            user = MAILMAN_UID
85            group = MAILMAN_GID
86
87 list_request_transport:
88            driver = pipe
89            command = MAILMAN_WRAP mailcmd ${lc:$local_part}
90            current_directory = MAILMAN_HOME
91            home_directory = MAILMAN_HOME
92            user = MAILMAN_UID
93            group = MAILMAN_GID
94
95 list_admin_transport:
96            driver = pipe
97            command = MAILMAN_WRAP mailowner ${lc:$local_part}
98            current_directory = MAILMAN_HOME
99            home_directory = MAILMAN_HOME
100            user = MAILMAN_UID
101            group = MAILMAN_GID
102
103 ### end of transports section fragment
104 </pre>
105     <h4>Directors config file section</h4>
106 <pre>
107 ## Directors section [this deals with local addresses]
108 ##
109 ## First 2 directors rewrite list-owner or owner-list to list-admin
110 ## This is only done if the list exists.
111 ## List existence checks are done by seeing if the file
112 ## MAILMAN_HOME/lists/<list>/config.db
113 ## exists.
114
115 list_owner_director:
116    driver = smartuser
117    require_files = MAILMAN_HOME/lists/${lc:$local_part}/config.db
118    suffix = "-owner"
119    new_address = "${lc:$local_part}-admin@${domain}"
120
121 owner_list_director:
122    driver = smartuser
123    require_files = MAILMAN_HOME/lists/${lc:$local_part}/config.db
124    prefix = "owner-"
125    new_address = "${lc:$local_part}-admin@${domain}"
126
127 ##
128 ## Next 3 directors direct admin, request and list mail to the appropriate
129 ## transport.  List existence is checked as above.
130
131 list_admin_director:
132    driver = smartuser
133    suffix = -admin
134    require_files = MAILMAN_HOME/lists/${lc:$local_part}/config.db
135    transport = list_admin_transport
136
137 list_request_director:
138    driver = smartuser
139    suffix = -request
140    require_files = MAILMAN_HOME/lists/${lc:$local_part}/config.db
141    transport = list_request_transport
142
143 list_director:
144    driver = smartuser
145    require_files = MAILMAN_HOME/lists/${lc:$local_part}/config.db
146    transport = list_transport
147
148 ## End of directors fragment
149 ## End of config files bits
150 </pre>
151
152 <p>Exim should be configured to allow reasonable volume - ie no
153 setting <tt>max_recipients</tt> down to a silly value, and with normal
154 degrees of security - ie allowing relaying from <tt>127.0.0.1</tt>
155 (thats vital), but pretty much nothing else.  Parallel deliveries and
156 other tweaks can also be used.  Delay warning messages should be
157 switched off or configured to only happen for non-list mail - unless
158 you like receiving tons of mail when a host is down.</p>
159
160 <h3>Problems</h3>
161 <ul>
162
163    <li>Mailman's detection of exim bounces needs improving - it really
164    should make use of the extra header information that exim provides.
165    It also should recognise and deal with or ignore delay warning
166    messages.  <i>Mailman 2.0beta does handle exim bounces correctly,
167    but still passes delay warnings to the list administrator</i></li>
168
169    <li>List existence is checked on whether there is a config.db file
170    for a list.  If you delete lists by foul means, be aware of
171    this.</li>
172
173    <li>If you are getting exim or Mailman complaining about user ids
174    when you send mail to a list, check that the MAILMAN_UID and
175    MAILMAN_GID match those of Mailman itself.  Also make sure you do
176    <b>not</b> have aliases in the main alias file for the list.</li>
177 </ul>
178
179     <h2>Other Tweaks</h2>
180
181     <p>One solution passed to me for handling virtual domains was -
182     <i>Since I use Mailman in a virtual domain configuration with a
183     separate installation for each virtual domain, I did a slight
184     modification like this:</i></p>
185
186 <pre>
187 ## transport configurations
188
189 command = "/virtual/${domain}/mailman/mail/wrapper post ${lc:$local_part}"
190 current_directory = /virtual/${domain}/mailman
191 home_directory = /virtual/${domain}/mailman
192
193 ## and in the director part:
194
195 require_files = /virtual/${domain}/mailman/lists/${lc:$local_part}/config.db
196
197 </pre>
198
199     <h2>Exim List Efficiency Tweaks</h2>
200
201     <p>This is a set of configuration directives I used on the list
202     boxes I admin.  Some of these are necessary, others are cosmetic,
203     a few are probably superfluous - they work for me!</p>
204 <pre>
205 # definition of injecting IP addresses
206 LOCAL_NETS=127.0.0.1/32
207 #
208 # Extra logging data - not necessary but makes the logs more
209 # useful, but bigger
210 # lookup all hostnames - puts hostnames into log as well as ips
211 host_lookup = 0.0.0.0/0
212 # tweak logging
213 log_all_parents
214 log_file_path = /var/log/exim/%s.log
215 log_received_recipients
216 log_refused_recipients
217 log_received_sender
218 log_smtp_confirmation
219 #
220 # RBL settings - these are more severe than I use
221 rbl_domains = rbl.maps.vix.com/reject:relays.mail-abuse.org/reject:dul.maps.vix.com/reject:relays.orbs.org=127.0.0.2,127.0.0.3/reject
222 rbl_hosts = !LOCAL_NETS:0.0.0.0/0
223 rbl_log_rcpt_count
224 recipients_reject_except=postmaster@*:*-admin@*
225 #
226 # relay control - from our local network only
227 host_accept_relay = LOCAL_NETS
228 #
229 # delay warnings - second line is now default, but earlier versions of
230 # exim need it setting
231 delay_warning = 26h
232 ##delay_warning_condition = "${if match{$h_precedence:}{(?i)bulk|list|junk}{no}{yes}}"
233 #
234 # Verify receipient addresses on everything except local injects
235 # DO NOT verify addresses from Mailman - this would slow down
236 # the acceptance of messages dramatically
237 receiver_verify_hosts = !127.0.0.1/8:0.0.0.0/0
238 sender_verify
239 #
240 # performance tweaks - 1st is good for linux, maybe less so for others
241 split_spool_directory
242 remote_max_parallel = 15
243 </pre>
244
245 <h2>List verification</h2>
246
247 <p>This is how a set of address tests for the exim lists look on a
248 working system. (command lines start with "&gt;")</p>
249 <pre>
250 > /usr/sbin/exim -v -bt exim-users
251 exim-users@www.exim.org
252   deliver to exim-users in domain www.exim.org
253   director = list_director, transport = list_transport
254
255 > /usr/sbin/exim -bt exim-users-request
256 exim-users-request@www.exim.org
257   deliver to exim-users in domain www.exim.org
258   director = list_request_director, transport = list_request_transport
259
260 > /usr/sbin/exim -bt exim-users-admin
261 exim-users-admin@www.exim.org
262   deliver to exim-users in domain www.exim.org
263   director = list_admin_director, transport = list_admin_transport
264
265     <hr>
266     <address><a href="mailto:Postmaster@exim.org">Nigel Metheringham</a></address>
267 <!-- Created: Mon Aug 25 15:46:41 BST 1997 -->
268     <h4>$Cambridge$</h4>
269   </body>
270 </html>