updated mailman docs
[exim-website.git] / howto / mailman21.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3   <head>
4     <title>HOWTO - Using Exim 4 and Mailman together</title>
5   </head>
6   <body bgcolor="#ffffff" text="#00005a" link="#ff6600" alink="#ff9933" vlink="#990000">
7     <h1>HOWTO - Using Exim 4 and Mailman 2.1 together</h1>
8
9     <p>Mailman is a list manager with web front end and built in
10     archiving functions.  Details can be found at <a
11     href="http://www.list.org/"> http://www.list.org/</a>.  This
12     documentation describes the configuration of Exim (version 4) to
13     work with Mailman version 2.1</p>
14
15     <a name="index"><h2>Index</h2></a>
16
17     <ul>
18       <li><a href="#scope">Scope of this document</a></li>
19       <li><a href="#basic">Basic Configuration</a></li>
20     <ul>
21       <li><a href="#mmconf">Mailman configuration</a></li>
22       <li><a href="#exconf">Exim configuration</a></li>
23       <li><a href="#maconf">Main configuration settings</a></li>
24       <li><a href="#roconf">Exim Router</a></li>
25       <li><a href="#taconf">Exim Transport</a></li>
26     </ul>
27     <li><a href="#batune">Basic mailing list MTA tuning</a></li>
28     <ul>
29       <li><a href="#retune">Receiver verification</a></li>
30       <li><a href="#rctune">Tuning of numbers of recipients</a></li>
31       <li><a href="#smtune">SMTP callback</a></li>
32     </ul>
33     <li><a href="#verpin">Doing VERP and personalisation with exim
34         and Mailman</a></li>
35     <ul>
36       <li><a href="#verpmm">VERP within Mailman</a></li>
37       <li><a href="#persmm">Mailing list personalisation by Mailman</a></li>
38       <li><a href="#verpex">VERP expansion by Exim rather than
39           Mailman</a></li>
40     </ul>
41     <li><a href="#virdom">Virtual domains</a></li>
42     <li><a href="#lispol">List policy management</a></li>
43     <ul>
44       <li><a href="#conpol">Content scanning</a></li>
45       <li><a href="#incpol">Incoming message checks</a></li>
46       <li><a href="#mmapol">Mailman specific ACL checks</a></li>
47     </ul>
48     <li><a href="#lisver">List verification</a></li>
49     <li><a href="#problem">Possible Problems</a></li>
50     <li><a href="#dochis">Document History</a></li>
51   </ul>
52
53     <a name="scope">&nbsp;</a>
54     <a href="#index"><h2>Scope of this document</h2></a>
55
56     <p>This document describes how to set up a basic working
57     configuration using Exim 4 as an MTA for the Mailman MLM.  The
58     assumption is made that the receiving MTA, Mailman and the list
59     distribution MTA are all on the same machine, and that Mailman
60     talks to Exim using SMTP to address <tt>127.0.0.1</tt></p>
61
62     <p>It also describes ways of using VERP delivery, both
63     conventionally (doing VERP from Mailman), and an alternative more
64     efficient technique where VERP expansion is done within exim.</p>
65
66     <p>Tuning and setting appropriate mailing list protection policies
67     is also covered in passing.</p>
68
69     <p>General installation, use, running and administration of either
70     Mailman or exim is not covered here - the documentation for the
71     programs concerned should be read for this information.</p>
72
73     <a name="basic">&nbsp;</a>
74     <a href="#index"><h2>Basic Configuration</h2></a>
75
76     <a name="mmconf">&nbsp;</a>
77     <a href="#index"><h3>Mailman configuration</h3></a>
78
79     <p>For basic operation there is no Mailman configuration needed
80     other than the standard options detailed in the Mailman install
81     documentation.  The user/group settings for Mailman must match
82     those in the config fragments given below, and you need to have at
83     least configured <tt>DEFAULT_URL_HOST</tt> and
84     <tt>DEFAULT_EMAIL_HOST</tt> within Mailman, for example by editing
85     <tt>~mailman/Mailman/mm_cfg.py</tt> and setting the following
86     (substituting in your own domains):-</p>
87
88 <pre>
89   # The host part of the URL used for your mailman install
90   DEFAULT_URL_HOST = 'www.example.com'
91   #
92   # The email domain of your lists
93   DEFAULT_EMAIL_HOST = 'list.example.com'
94   #
95   # Let Mailman know that the MTA needs no aliases setting
96   MTA = None
97 </pre>
98
99     <p>The final setting above informs Mailman that it does not need
100     to prompt you to add aliases when creating a list (like Sendmail),
101     or modify other settings (like Postfix).  Not setting this will
102     mean that Mailman nags you to do things that aren't necessary in
103     an Exim configuration.</p>
104
105     <p>After making a change to the Mailman configuration file you
106     need to restart the Mailman queue runners.</p>
107
108 <pre>
109   ~mailman/bin/mailmanctl restart
110 </pre>
111
112     <p>Mailman should also be set to deliver to the MTA using SMTP -
113     this is done by having <tt>DELIVERY_MODULE = 'SMTPDirect'</tt> in
114     the config file (which is the default mode of operation)</p>
115
116
117     <a name="exconf">&nbsp;</a>
118     <a href="#index"><h3>Exim configuration</h3></a>
119
120     <p>The Exim configuration is built so that a list created within
121     Mailman automatically appears to Exim without the need for
122     defining any additional aliases (however Mailman may helpfully
123     show or email you a list of required aliases when you create a
124     list - you can just ignore those - if you have set the
125     <tt>MTA</tt> parameter it will stop doing this).</p>
126
127     <p>The drawback of this configuration is that it will work poorly
128     on systems supporting lists in several different mail domains.
129     While Mailman handles virtual domains, it does not yet support
130     having two distinct lists with the same name in different virtual
131     domains, using the same Mailman installation.  This will
132     eventually change.  (But see below for a variation on this scheme
133     that should accommodate virtual domains better.)</p>
134
135     <p>The configuration file excerpts below are for use in an already
136     functional Exim configuration.  You also need to have an alias for
137     <tt>mailman</tt> within the <tt>mm_domains</tt>, this picks up
138     mail sent to the site list (or basically just sent in error), and
139     should forward to the Mailman Administrator.  It appears that a
140     couple of Mailman messages mention the <tt>mailman-admin</tt>
141     address (this appears to be an error in Mailman or maybe a
142     packaging error), so I would suggest that <tt>mailman-admin</tt>
143     is aliased also to the Mailman Administrator.</p>
144
145     <p><i>[Note: the instructions in this document will work only with
146     Exim 4.  It may be possible to adapt them for Exim 3, but frankly
147     it is not worth the trouble]</i></p>
148
149     <p>You will need to add some macros to the main section of your
150     Exim config file.  You will also need to define one new transport
151     and add new routers.  Additional ACLs may be used to handle policy
152     enforcement.  Remember that the exim daemon needs restarting
153     before it sees configuration changes.</p>
154
155     <a name="maconf">&nbsp;</a>
156     <a href="#index"><h3>Main configuration settings</h3></a>
157
158     <p>First, you need to add some macros to the top of your Exim
159     config file.  These just make the routers and transport below a
160     bit cleaner.  Obviously, you'll need to edit these based on how
161     you configured and installed Mailman.</p>
162
163 <pre>
164   # Home dir for your Mailman installation -- aka Mailman's prefix
165   # directory.
166   # By default this is set to "/usr/local/mailman"
167   # On a Red Hat/Fedora system using the RPM use "/var/mailman"
168   # On Debian using the deb package use "/var/lib/mailman"
169   # This is normally the same as ~mailman
170   MM_HOME=/var/mailman
171   #
172   # User and group for Mailman, should match your --with-mail-gid
173   # switch to Mailman's configure script.
174   # Value is normally "mailman"
175   MM_UID=mailman
176   MM_GID=mailman
177   #
178   # Domains that your lists are in - colon separated list
179   # you may wish to add these into local_domains as well
180   domainlist mm_domains=list.example.com
181   #
182   # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
183   #
184   # These values are derived from the ones above and should not need
185   # editing unless you have munged your mailman installation
186   #
187   # The path of the Mailman mail wrapper script
188   MM_WRAP=MM_HOME/mail/mailman
189   #
190   # The path of the list config file (used as a required file when
191   # verifying list addresses)
192   MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck
193 </pre>
194
195     <a name="roconf">&nbsp;</a>
196     <a href="#index"><h3>Exim Router</h3></a>
197
198     <p>This router picks up all the addresses going to the Mailman
199     lists.  Initially it selects only the domains that have may have
200     lists in, then selects where <tt>local_part</tt> matches a list
201     name (ie you can see a list config file).  The suffixes pick up
202     all the Mailman admin addresses<p>
203
204     <p>The router should be placed in the router section (ie somewhere
205     after the <tt>"begin routers"</tt> line of your config file).
206     Normally you would place it just after the aliases router (since
207     that will pick up the <tt>mailman</tt> master contact
208     address).</p>
209
210 <pre>
211   mailman_router:
212     driver = accept
213     domains = +mm_domains
214     require_files = MM_LISTCHK
215     local_part_suffix_optional
216     local_part_suffix = -admin     : \
217                         -bounces   : -bounces+* : \
218                         -confirm   : -confirm+* : \
219                         -join      : -leave     : \
220                         -owner     : -request   : \
221                         -subscribe : -unsubscribe
222     transport = mailman_transport
223 </pre>
224
225     <a name="taconf">&nbsp;</a>
226     <a href="#index"><h3>Exim Transport</h3></a>
227
228     <p>The transport for Exim 4 can be placed anywhere where under the
229     <tt>begin transports</tt> line of your Exim config file.</p>
230
231     <p>The <tt>if def:local_part_suffix</tt> section selects whether
232     the suffix is used as the mailman command, or whether there is no
233     suffix and so <tt>post</tt> is passed as a command.</p>
234
235     <p>The <tt>sg</tt> phrase strips the VERP information (if any)
236     from the suffix,</p>
237
238 <pre>
239   mailman_transport:
240     driver = pipe
241     command = MM_WRAP \
242               '${if def:local_part_suffix \
243                     {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \
244                     {post}}' \
245               $local_part
246     current_directory = MM_HOME
247     home_directory = MM_HOME
248     user = MM_UID
249     group = MM_GID
250 </pre>
251
252
253     <a name="batune">&nbsp;</a>
254     <a href="#index"><h2>Basic mailing list MTA tuning</h2></a>
255
256     <p>Exim has a lot configurability, especially where the ACL
257     (Access Control Lists) used during SMTP reception are concerned.
258     MTA policy needs to be tuned so that list traffic is not affected
259     by ACLs intended for qualifying traffic coming in from outside.
260     Later in this document some suggestions are made regarding
261     filtering traffic that is going into the mailing list, however
262     </p>
263
264     <a name="retune">&nbsp;</a>
265     <a href="#index"><h3>Receiver verification</h3></a>
266
267     <p>Exim's receiver verification feature is very useful -- it lets
268     Exim reject unrouteable addresses at SMTP time.  However, this is
269     most useful for externally-originating mail that is addresses to
270     mail in one of your local domains.  For Mailman list traffic, mail
271     originates on your server, and is addressed to random external
272     domains that are not under your control.  Furthermore, each
273     message is addressed to many recipients -- up to 500 if you use
274     Mailman's default configuration, and don't tweak
275     <tt>SMTP_MAX_RCPTS</tt>.</p>
276
277     <p>Doing receiver verification on Mailman list traffic is a recipe
278     for trouble.  In particular, Exim will attempt to route every
279     recipient addresses in outgoing Mailman list posts.  Even though
280     this requires nothing more than a few DNS lookups for each
281     address, it can still introduce significant delays (because these
282     verifications have to be done serially as you attempt handoff to
283     exim).  Therefore, you should disable recipient verification for
284     Mailman traffic.</p>
285
286     <p>Under Exim 4, this is probably already taken care of for you by
287     the default recipient verification ACL statement (in the "RCPT TO"
288     ACL):</p>
289
290 <pre>
291   accept  domains       = +local_domains
292           endpass
293           message       = unknown user
294           verify        = recipient
295 </pre>
296
297     <p>which only does recipient verification on addresses in your
298     domain.  (That's not exactly the same as doing recipient
299     verification only on messages coming from non-127.0.0.1 hosts, but
300     it should do the trick for Mailman).  Obviously if the next ACL
301     does verification on non-local addresses you will need to deal
302     with that.</p>
303
304     <p>Alternatively you can add an early get-out in the "RCPT TO"
305     ACL), which <i>trusts</i> all traffic coming from the loopback IP
306     address:</p>
307
308 <pre>
309   accept  hosts         = 127.0.0.1
310 </pre>
311
312     <a name="rctune">&nbsp;</a>
313     <a href="#index"><h3>Tuning of numbers of recipients</h3></a>
314
315     <p>By default Mailman will send up to 500 recipients on each
316     message it injects into exim.  However this is not necessarily a
317     good configuration for exim since it will route all those
318     recipients before starting deliveries to any of them.
319     Additionally some ACL configurations have tests on the maximum
320     number of recipients (which is a good reason for having a get out
321     ACL for list traffic as described above)</p>
322
323     <p>I would suggest setting Mailman to send a maximum of 5 to 50
324     recipients on a single mail (setting it lower decreases list
325     latency, but increases the work that Mailman and exim have to do),
326     and change it to send a maximum of 30 messages per SMTP
327     connection.  To reflect this you should also change the exim
328     parameter <tt>smtp_accept_queue_per_connection</tt> to be 30 as
329     well.</p>
330
331     <p>For example, add the following lines to
332     <tt>~mailman/Mailman/mm_cfg.py</tt>:</p>
333
334 <pre>
335   # Max recipients for each message
336   SMTP_MAX_RCPTS = 15
337   # Max messages sent in each SMTP connection
338   SMTP_MAX_SESSIONS_PER_CONNECTION = 30
339 </pre>
340
341     <p>Tuning a mailing list system is very much a black art, and
342     depends on the type of lists you host, their throughput, size and
343     the bandwidth available.  In general, tuning is only a significant
344     issue if you are pushing your system near its operational
345     limits.</p>
346
347     <a name="verpin">&nbsp;</a>
348     <a href="#index"><h2>Doing VERP and personalisation with exim and Mailman</h2></a>
349
350     <a name="verpmm">&nbsp;</a>
351     <a href="#index"><h3>VERP within Mailman</h3></a>
352
353     <p><a href="http://cr.yp.to/proto/verp.txt">VERP</a> (Variable
354     Envelope Return Paths) encodes the (original) receipient address
355     in the sender address.  The reason for doing this is that it means
356     bounces are sent to an address which has the original recipient
357     address encoded in it - meaning you know which recipient address
358     caused the bounce.  This makes automatic bounce handling very
359     effective - the normal method of parsing the bouncing address out
360     of the bounce message is very prone to failure, especially in the
361     case of foreign MTAs which use different addressing standards, or
362     where mail forwarding is involved.</p>
363
364     <p>VERP will send one email, with a separate envelope sender
365     (return path), for each of your subscribers - this means that it
366     will generate more traffic since you cannot bundle up deliveries
367     together.  An <a
368     href="http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq04.012.htp">analysis
369     of the costs of VERP</a> can be found in the <a
370     href="http://www.python.org/cgi-bin/faqw-mm.py">Mailman FAQ
371     Wizard</a>.</p>
372
373     <p>VERP settings within Mailman are done on a per-installation
374     basis - ie they affect all the lists within the installation. To
375     configure VERP within Mailman read the information in
376     <tt>~mailman/Mailman/Default.py</tt> for the options that start
377     with <tt>VERP</tt>.  In a nutshell, all you need to do to enable
378     VERP with Exim is to add these lines to
379     <tt>~mailman/Mailman/mm_cfg.py</tt>:</p>
380
381 <pre>
382   VERP_PASSWORD_REMINDERS = 1
383   VERP_PERSONALIZED_DELIVERIES = 1
384   VERP_CONFIRMATIONS = 1
385   VERP_DELIVERY_INTERVAL = 1
386 </pre>
387
388     <p>(The router and ACLs above are smart enough to deal with VERP
389     bounces.)</p>
390
391     <p>This configuration on its own will make the monthly password
392     reminders, confirmations and all list postings be sent out using
393     VERP</p>
394
395     <p>If you wish to have the advantages of VERP with a lower
396     bandwidth cost, you can enable VERP on occasional list postings
397     rather than on every posting.  Mailman will still VERP on all
398     password reminders and confirmations (these are already inherently
399     single recipient mailings), but only on occasional list postings.
400     To make Mailman use VERP on every twentieth list posting (using
401     bulk delivery for the other 19), change:-</p>
402
403 <pre>
404   VERP_DELIVERY_INTERVAL = 20
405 </pre>
406
407     <p>The downside to doing this is that Mailman may fail to notice a
408     bouncing address if it does not receive at least one bounce per
409     day, so ideally this approach should only be taken if the lists
410     have more than 20 message per day throughput.</p>
411
412     <a name="persmm">&nbsp;</a>
413     <a href="#index"><h3>Mailing list personalisation by Mailman</h3></a>
414
415     <p>Mailman can also personalise each message it sends out on a
416     list.  This allows, for example, the recipient's own address to
417     appear as the To: header, or information specific to them to be
418     placed in the mail footer (although at present personalisation can
419     only be done for normal mail delivery - not for digest
420     subscribers).  This personalisation comes at a cost of an
421     individual message per recipient (ie same bandwidth requirements
422     as full VERP) and some processing costs for Mailman.</p>
423
424     <p>To enable personalisation, add the following configuration item
425     to <tt>~mailman/Mailman/mm_cfg.py</tt> (you should also set the
426     VERP settings from above since you have already incurred the costs
427     of VERP):-</p>
428
429 <pre>
430   OWNERS_CAN_ENABLE_PERSONALIZATION = 1
431 </pre>
432
433     <p>You will then find that in the list administration web
434     interface a new set of options has appeared in the <i>Non-digest
435     options</i> section.</p>
436
437     <a name="verpex">&nbsp;</a>
438     <a href="#index"><h3>VERP expansion by exim rather than Mailman</h3></a>
439
440     <p>One drawback of VERP is that as well as increasing the
441     bandwidth outgoing mail requires, it also causes Mailman to send
442     one separate message per recipient from Mailman to exim - causing
443     exim to have many many more queue entries and consequently more
444     queue disk space.  For example a 20,000 recipient list would
445     require 400MB minimum temporary queue storage for each 20KB
446     message sent to the list.  There are also issues of increasing
447     disk traffic/throughput and losing some disk caching
448     advantages.</p>
449
450     <p>These local load problems can be overcome by doing the VERP
451     expansion as the message is sent out from the MTA over network
452     SMTP rather than as the message is injected into the MTA.  It will
453     come as no surprise that exim can be configured to do just
454     this.</p>
455
456     <p>Firstly we need to pick up outgoing Mailman mail and send it to
457     a specialised VERP transport.  This is done using a router which
458     should be placed just before your normal <tt>dnslookup</tt> router
459     for remote addresses:-</p>
460
461 <pre>
462   # Pick up on messages from our local mailman and route them via our
463   # special VERP-enabled transport
464   #
465   mailman_verp_router:
466     driver = dnslookup
467     # we only consider messages sent in through loopback
468     condition = ${if eq{$sender_host_address}{127.0.0.1}{yes}{no}}
469     # we do not do this for traffic going to the local machine
470     domains = !+local_domains:!+mm_domains
471     ignore_target_hosts = <; 0.0.0.0; \
472                              127.0.0.0/8; \
473                              ::1/128; \
474                              fe80::/10; \
475                              ff00::/8
476     # only the un-VERPed bounce addresses are handled
477     senders = "*-bounces@*"
478     transport = mailman_verp_smtp
479 </pre>
480
481     <p>Addresses selected by this router should then be passed on to
482     an SMTP transport that does VERP expansion.  This should be placed
483     anywhere within the transport section:-</p>
484
485 <pre>
486   # Mailman VERP envelope sender address formatting.  This seems not to use
487   # quoted-printable encoding of the address, but instead just replaces the
488   # '@' in the recipient address with '='.
489   #
490   mailman_verp_smtp:
491     driver = smtp
492     # put recipient address into return_path
493     return_path = \
494       ${local_part:$return_path}+$local_part=$domain@${domain:$return_path}
495     # must restrict to one recipient at a time
496     max_rcpt = 1
497     # Errors-To: may carry old return_path
498     headers_remove = Errors-To
499     headers_add = Errors-To: \
500       ${local_part:$return_path}+$local_part=$domain@${domain:$return_path}
501 </pre>
502
503     <p>Once this has been configured, Mailman can be set to not do
504       VERP expansion on normal list deliveries - the VERP
505       configuration should now look like:-</p>
506 <pre>
507   VERP_PASSWORD_REMINDERS = 1
508   VERP_PERSONALIZED_DELIVERIES = 1
509   VERP_CONFIRMATIONS = 1
510   VERP_DELIVERY_INTERVAL = 0
511 </pre>
512
513     <p>If you have set personalisation on any list, this will still be
514     handled, and VERPed, by Mailman.</p>
515
516     <a name="virdom">&nbsp;</a>
517     <a href="#index"><h2>Virtual domains</h2></a>
518
519     <p>One approach to handling virtual domains is to use a separate
520     Mailman installation for each virtual domain.  (Currently, this is
521     the only way to have lists with the same name in different virtual
522     domains handled by the same machine.)</p>
523
524     <p>In this case, you must change the <tt>MM_HOME</tt> macro to
525     something like this:-</p>
526
527 <pre>
528   MM_HOME=/virtual/${lc::$domain}/mailman
529 </pre>
530
531     <p>and modify the <tt>mm_domains</tt> domain list appropriately.</p>
532
533     <a name="lispol">&nbsp;</a>
534     <a href="#index"><h2>List policy management</h2></a>
535
536     <p>Most list policy handling is done within Mailman using the Web
537     GUI.  However some issues may be better handled by the MTA,
538     especially matters of overall site policy (not just mailing list
539     policy).  For example you may wish to do virus or spam scanning on
540     incoming messages.</p>
541
542     <p>In general you exclude outgoing list mail from any policy
543     controls.  This is because outgoing list mail has already been
544     through the policy controls on the way into the system.
545     Additionally spam scanning (for example) is a machine intensive
546     operation, and scanning a message that has already been scanned,
547     and then replicated to many recipients, is going to be very
548     expensive as well as ineffective.  For this reason you will
549     normally have an <tt>accept</tt> clause early on in your ACLs that
550     causes Mailman generated traffic to bypass the machine intensive
551     checks.</p>
552
553     <a name="conpol">&nbsp;</a>
554     <a href="#index"><h3>Content scanning</h3></a>
555
556     <p>I would recommend that mailing lists now scan for both spam and
557     viruses on incoming mail - this is due to the potential for a
558     compromised windows machine belonging to a subscriber managing to
559     distribute unwanted content via the list.  This causes problems
560     not only to the list reputation, but also to the list manager who
561     will get many many bounces from subscribers who do content
562     scanning on their own incoming mail.</p>
563
564     <p>The best way to do this is using the <a
565     href="http://duncanthrax.net/exiscan-acl/">exiscan</a> extension
566     along with a virus scanner such as <a
567     href="http://duncanthrax.net/exiscan-acl/">clam-av</a> and a spam
568     content scanner such as <a
569     href="http://www.spamassassin.org/">SpamAssassin</a>. Configuring
570     these is beyond the scope of this document, however Tim Jackson
571     has a very good set of <a
572     href="http://www.timj.co.uk/linux/Exim-SpamAndVirusScanning.pdf">PDF
573     documentation</a> on integrating these.</p>
574
575     <p>One thing to note is that if you add full SpamAssassin headers
576     onto list messages this bulks up the messages significantly.
577     These headers are also available to list subscribers, which might
578     make it easier for someone malicious to work out how to evade your
579     spam scanning strategy.  I would suggest that Spam headers are not
580     added for Mailman incoming mail, or minimal (short) headers added,
581     or that they are stripped somewhere.  However having minimal
582     headers on means that you can, for example, moderate all messages
583     which have a given spam rating (as well as bouncing messages with
584     a very high rating).</p>
585
586     <a name="incpol">&nbsp;</a>
587     <a href="#index"><h3>Incoming message checks</h3></a>
588
589     <p>You may wish to apply various checks to incoming messages to
590     ensure that they are sane.  These may include:-</p>
591
592     <ul>
593       <li>DNSBL checks</li>
594       <li>Header checks</li>
595       <li>Sender callback verification</li>
596     </ul>
597
598     <p>However all of these do have some degree of false positive
599     ratings.  You need to be aware of how much of your user base you
600     may alienate by imposing too strict a set of controls, and balance
601     that against the reduced amount of unwanted bulk mail.</p>
602
603     <a name="mmapol">&nbsp;</a>
604     <a href="#index"><h3>Mailman specific ACL checks</h3></a>
605
606     <p>Lists should never receive bounce messages to the posting
607     address unless the bounced message is either a forgery using the
608     list address as the sender address, or the bouncing MTA is
609     terminally broken.  In either of these cases we really are not
610     interested in receiving the messages and can reject them at SMTP
611     time with a clear conscience.  The ACL to do this (as part of the
612     RCPT ACL) is:-</p>
613
614 <pre>
615   # Reject bounce (null sender) messages to the list
616   reject   message = "Recipient never sends mail so cannot cause bounces"
617            senders = :
618            domains = +mm_domains
619            condition = ${if exists{MM_LISTCHK} {yes}{no}}
620 </pre>
621
622     <p>Additionally other mailman addresses do not generate mail (as
623     the envelope sender, although they may be mentioned in the header
624     addresses.  The ACL is split into 2 so that it can be written
625     without the local_part condition wrapping.</p>
626
627 <pre>
628   # Reject bounce (null sender) messages to the list
629   reject   message = "Recipient never sends mail so cannot cause bounces"
630            senders = :
631            domains = +mm_domains
632            local_parts = \N^.*-(admin|join|leave|owner|request)$\N
633   reject   message = "Recipient never sends mail so cannot cause bounces"
634            senders = :
635            domains = +mm_domains
636            local_parts = \N^.*-(subscribe|unsubscribe)$\N
637 </pre>
638
639     <a name="smtune">&nbsp;</a>
640     <a href="#index"><h3>SMTP callbacks</h3></a>
641
642     <p>Exim's SMTP callback feature is an even more powerful way to
643     detect bogus sender addresses than normal sender verification.
644     They are specially useful for checking envelope sender addresses
645     at RCPT time within SMTP, and have been to date the most effective
646     single anti-SPAM measure (however it should be noted that CBV is
647     hated vehemently by some mail admins, and does increase both
648     latency and traffic, as well as theoretically being a means to set
649     up a DDOS situation).</p>
650
651     <p>It is recommended that SMTP Sender CBV is not carried out on
652     messages to the Mailman bounce handlers, so that broken remote
653     MTAs (specifcally ones which send bounces with something other
654     than a null sender address) do not get excluded from being taken
655     off mailing lists</p>
656
657 <pre>
658   # Do callback verification unless Mailman incoming bounce
659   reject   !local_parts = *-bounces : *-bounces+*
660            !verify = sender/callout=30s,defer_ok
661
662 </pre>
663
664     <p>Callback verification can also be done on header addresses, but
665     care should be taken not to reject messages unnecessarily,
666     especially when the message is going to Mailman's bounce
667     processor</p>
668
669     <a name="lisver">&nbsp;</a>
670     <a href="#index"><h2>List verification</h2></a>
671
672     <p>This is how a set of address tests for the Exim lists look on a
673     working system.  The list in question is
674     <tt>testlist@list.example.com</tt>, and these commands were
675     run on the <tt>list.example.com</tt> mail server (<tt>"% "</tt>
676     indicates the Unix shell prompt):</p>
677
678 <pre>
679   % exim -bt testlist@list.example.com
680   testlist@list.example.com
681     router = mailman_router, transport = mailman_transport
682   
683   % exim -bt testlist-request@list.example.com
684   testlist-request@list.example.com
685     router = mailman_router, transport = mailman_transport
686   
687   % exim -bt testlist-bounces@list.example.com
688   testlist-bounces@list.example.com
689     router = mailman_router, transport = mailman_transport
690   
691   % exim -bt testlist-bounces+luser=example.com@list.example.com
692   testlist-bounces+luser=example.com@list.example.com
693     router = mailman_router, transport = mailman_transport
694 </pre>
695
696     <p>If your <tt>"exim -bt"</tt> output looks something like this,
697     that's a start: at least it means Exim will pass the right
698     messages to the right Mailman commands.  It by no means guarantees
699     that your Exim/Mailman installation is functioning perfectly,
700     though!</p>
701
702     <a name="problem">&nbsp;</a>
703     <a href="#index"><h2>Possible Problems</h2></a>
704
705     <ul>
706
707       <li> Mailman will send as many <tt>MAIL FROM/RCPT TO</tt> as it
708       needs. It may result in more than 10 or 100 messages sent in one
709       connection, which will exceed the default value of Exim's
710       smtp_accept_queue_per_connection This is bad because it will
711       cause Exim to switch into queue mode and severely delay delivery
712       of your list messages.  The way to fix this is to set mailman's
713       <tt>SMTP_MAX_SESSIONS_PER_CONNECTION</tt> (in
714       <tt>~mailman/Mailman/mm_cfg.py</tt>) to a smaller value than
715       Exim's <tt>smtp_accept_queue_per_connection</tt></li>
716
717       <li>Mailman should ignore Exim delay warning messages, even
718       though Exim should never send this to list messages.  Mailman
719       2.1's general bounce detection and VERP support should greatly
720       improve the bounce detector's hit rates.</li>
721
722       <li>List existence is determined by the existence of a
723       <tt>config.pck</tt> file for a list.  If you delete lists by
724       foul means, be aware of this.</li>
725
726       <li>If you are getting Exim or Mailman complaining about user
727       ids when you send mail to a list, check that the
728       <tt>MM_UID</tt> and <tt>MM_GID</tt> match those of
729       Mailman itself (i.e. what were used in the configure script).
730       Also make sure you do not have aliases in the main alias file
731       for the list.</li>
732
733     </ul>
734
735     <a name="dochis">&nbsp;</a>
736     <a href="#index"><h2>Document History</h2></a>
737
738     <ul>
739       <li>Originally written by Nigel Metheringham.</li>
740       <li>Updated by Marc Merlin for Mailman 2.1, Exim 4</li>
741       <li>Overhauled/reformatted/clarified/simplified by Greg
742         Ward.</li>
743       <li>Rehashed again by Nigel Metheringham</li>
744     </ul>
745
746     <p>Like many documents of this type, it has evolved and taken on
747     contributions by many many helpful folks, mainly those on the
748     Mailman and exim mailing lists.  To all of you, who have made
749     contributions yet had their names shamefully lost by me, <i>Thank
750     You</i>.</p>
751
752     <hr>
753     <h4>$Id: mailman21.html,v 1.7 2004/06/07 12:14:31 nigel Exp $</h4>
754   </body>
755 </html>