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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
This is a snapshot of the Exim & Mailman HOWTO document. The current
original document can be found on the exim web site at
http://www.exim.org/howto/mailman.html
=======================================================================
HOWTO - Using exim and mailman together
Mailman is a list manager with web front end and built in archiving
functions. Details can be found at [1] http://www.list.org/
Mailman configuration
There is no Mailman configuration needed other than the standard
options detailed in the Mailman install documentation. The exim
configuration is transparent to Mailman. The uid/gid settings for
Mailman must match those in the config fragments given below.
Exim configuration
The Exim configuration is built so that a list created within
Mailman automagically appears to Exim without the need for
additional alias files to be changed.
The drawback of this configuration is that it will work poorly on
systems supporting lists in several different mail domains. While
Mailman handles virtual domains, it does not yet support having two
lists with the same name in different virtual domains, using the
same Mailman installation. This will eventually change.
The configuration file segments included are to be built on top of
an already functional Exim configuration, which accepts mail for
the domain in which the list resides (i.e. that domain is already
in local_domains) - should this domain be separate from the others
handled by this Exim, then add the list domain to local_domains,
add a domains=my.list.domain option to each of the directors and
you may wish to exclude that domain from the other directors.
There are 3 config file sections below which need pasting into the
appropriate parts of the main exim config file. The first one may also
need tailoring to your Mailman configuration. Note that these have
been written to allow you to have co-habitating Mailman 2.0.x and
Mailman 2.1 installations.
------------------------- ALL EXIM CONFIGURATION -----------------------------
## Top section of config file - macro definitions. Tailor these to
## fit your installation; pretty much everything else should just
## fit...
##
# Home dir for your Mailman installation
MAILMAN_HOME=/var/local/mailman
# Wrapper script for Mailman
MAILMAN_WRAP=MAILMAN_HOME/mail/mailman
# User and group for Mailman, should match your --with-mail-gid
# switch to Mailman's configure script.
MAILMAN_UID=mail
MAILMAN_GID=mail
------------------------- ALL EXIM CONFIGURATION -----------------------------
The second half of the configuration is different depending on whether you
use exim 3.x or exim 4.x
------------------------- EXIM 3.x CONFIGURATION -----------------------------
Transports config file section
## Transports section
##
## For Mailman 2.1, you only need one transport, albeit with a rather
## elaborate command...
mm21_transport:
driver = pipe
# In case you wonder, substr_2 removes the leading '-'
# and the regex removes optional +foo=hostname that can be after -bounce
# (if you use VERP) -- Marc
command = MAILMAN_WRAP "${if def:local_part_suffix{${substr_2:{${sg{${lc:$local_part_suffix}}{\\\\\+.*}{}}}}{post}}" ${lc:$local_part}
current_directory = MAILMAN_HOME
home_directory = MAILMAN_HOME
user = MAILMAN_UID
group = MAILMAN_GID
### end of transports section fragment
Directors config file section
## Directors section [this deals with local addresses]
##
## List existence checks are done by seeing if the file
## MAILMAN_HOME/lists/*/config.pck exists.
# Directors magic to support mailman lists without explicit aliases
# We want this director first in case we have a list named something like
# mailman-owner -- Marc
mm21_main_director:
driver = smartuser
require_files = MAILMAN_HOME/lists/${lc:$local_part}/config.pck
transport = mm21_transport
mm21_director:
driver = smartuser
require_files = MAILMAN_HOME/lists/${lc:$local_part}/config.pck
suffix = "-bounces:-bounces+*:-confirm+*:-join:-leave:-owner:-request:-admin"
transport = mm21_transport
### end of directors section fragment
------------------------- EXIM 3.x CONFIGURATION -----------------------------
------------------------- EXIM 4.x CONFIGURATION -----------------------------
Transports config file section
## Transports section
##
## For Mailman 2.1, you only need one transport, albeit with a rather
## elaborate command...
mm21_transport:
driver = pipe
# In case you wonder, substr_2 removes the leading '-'
# and the regex removes optional +foo=hostname that can be after -bounce
# (if you use VERP) -- Marc
command = MAILMAN_WRAP "${if def:local_part_suffix{${substr_2:{${sg{${lc:$local_part_suffix}}{\\\\\+.*}{}}}}{post}}" ${lc:$local_part}
current_directory = MAILMAN_HOME
home_directory = MAILMAN_HOME
user = MAILMAN_UID
group = MAILMAN_GID
Directors config file section
## Directors section [this deals with local addresses]
##
## List existence checks are done by seeing if the file
## MAILMAN_HOME/lists/*/config.pck exists.
# Directors magic to support mailman lists without explicit aliases
# We want this director first in case we have a list named something like
# mailman-owner
mm21_main_director:
driver = accept
require_files = MAILMAN_HOME/lists/${lc::$local_part}/config.pck
transport = mm21_transport
mm21_director:
driver = accept
require_files = MAILMAN_HOME/lists/${lc::$local_part}/config.pck
local_part_suffix = "-bounces:-bounces+*:-confirm+*:-join:-leave:-owner:-request:-admin"
transport = mm21_transport
### end of directors section fragment
------------------------- EXIM 4.x CONFIGURATION -----------------------------
Notes
Exim should be configured to allow reasonable volume - i.e. no
setting max_recipients down to a silly value, and with normal
degrees of security - ie allowing relaying from 127.0.0.1 (thats
vital), but pretty much nothing else. Parallel deliveries and
other tweaks can also be used. Delay warning messages should be
switched off or configured to only happen for non-list mail -
unless you like receiving tons of mail when a host is down.
Problems
* Mailman will send as many MAIL FROM/RCPT TO as it needs. It may result
in more than 10 or 100 messages sent in one connection, which will exceed
the default value of exim's smtp_accept_queue_per_connection
This is bad because it will cause exim to switch into queue mode and
severely delay delivery of your list messages.
The way to fix this is to set mailman's SMTP_MAX_SESSIONS_PER_CONNECTION
(in ~mailman/Mailman/mm_cfg.py) to a smaller value than exim's
smtp_accept_queue_per_connection
* Mailman should ignore Exim delay warning messages, even though
Exim should never send this to list messages. Mailman 2.1's
general bounce detection and VERP support should greatly improve
the bounce detector's hit rates.
* List existence is checked on whether there is a config.pck file
for a list. If you delete lists by foul means, be aware of this.
* If you are getting Exim or Mailman complaining about user ids
when you send mail to a list, check that the MAILMAN_UID and
MAILMAN_GID match those of Mailman itself (i.e. what were used
in the configure script). Also make sure you do not have
aliases in the main alias file for the list.
Doing VERP with exim and mailman
VERP will send one Email for each of your subscribers, read the information
in ~mailman/Mailman/Default.py for the options that start with VERP.
In a nutshell, all you need to do to enable VERP with exim is:
VERP_PASSWORD_REMINDERS = 1
VERP_PERSONALIZED_DELIVERIES = 1
VERP_DELIVERY_INTERVAL = 1
VERP_CONFIRMATIONS = 1
(the magic directors above are smart enough to deal with VERP bounces)
-- Marc
Other Tweaks
NOTE: This section may need rewriting...
One solution passed to me for handling virtual domains was - since
I use Mailman in a virtual domain configuration with a separate
installation for each virtual domain, I did a slight modification
like this:
## transport configurations
command = "/virtual/${domain}/mailman/mail/mailman post ${lc:$local_part}"
current_directory = /virtual/${domain}/mailman
home_directory = /virtual/${domain}/mailman
## and in the director part:
require_files = /virtual/${domain}/mailman/lists/${lc:$local_part}/config.pck
Exim List Efficiency Tweaks
This is a set of configuration directives I used on the list boxes
I admin. Some of these are necessary, others are cosmetic, a few
are probably superfluous - they work for me!
# definition of injecting IP addresses
LOCAL_NETS=127.0.0.1/32
#
# Extra logging data - not necessary but makes the logs more
# useful, but bigger
# lookup all hostnames - puts hostnames into log as well as ips
host_lookup = 0.0.0.0/0
# tweak logging
log_all_parents
log_file_path = /var/log/exim/%s.log
log_received_recipients
log_refused_recipients
log_received_sender
log_smtp_confirmation
#
# relay control - from our local network only
host_accept_relay = LOCAL_NETS
#
# delay warnings - second line is now default, but earlier versions of
# exim need it setting
delay_warning = 26h
##delay_warning_condition = "${if match{$h_precedence:}{(?i)bulk|list|junk}{no}
{yes}}"
#
# Verify receipient addresses on everything except local injects
# DO NOT verify addresses from mailman - this would slow down
# the acceptance of messages dramatically
receiver_verify_hosts = !127.0.0.1/8:0.0.0.0/0
sender_verify
#
# performance tweaks - 1st is good for linux, maybe less so for others
split_spool_directory
remote_max_parallel = 15
# Accept up to 100 messages in one connection, and make sure you also set
# mailman's SMTP_MAX_SESSIONS_PER_CONNECTION to a value lower than that -- Marc
smtp_accept_queue_per_connection = 100
List verification
This is how a set of address tests for the exim lists look on a
working system. (command lines start with ">")
> /usr/sbin/exim -v -bt exim-users
exim-users@www.exim.org
deliver to exim-users in domain www.exim.org
director = list_director, transport = list_transport
> /usr/sbin/exim -bt exim-users-request
exim-users-request@www.exim.org
deliver to exim-users in domain www.exim.org
director = list_request_director, transport = list_request_transport
> /usr/sbin/exim -bt exim-users-admin
exim-users-admin@www.exim.org
deliver to exim-users in domain www.exim.org
director = list_admin_director, transport = list_admin_transport
__________________________________________________________________________
[2]Nigel Metheringham & [3]Marc MERLIN (exim 4, directors, and VERP updates)
References
1. http://www.list.org/
2. mailto:Postmaster@exim.org
3. mailto:marc_soft@merlins.org
|