File: README.exim_v3

package info (click to toggle)
amavisd-new 1%3A2.10.1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,200 kB
  • sloc: perl: 33,232; sh: 529; sql: 158; makefile: 8
file content (262 lines) | stat: -rw-r--r-- 7,178 bytes parent folder | download | duplicates (6)
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
Debian notes:

1. Install amavisd-new-milter. It contains /usr/sbin/amavis,
which is required for the following instructions to work.
--- cut ---

+======================================================================+
| (Please see instructions in README.exim_v4. The setup described here |
| is not recommended with amavisd-new + Exim v4)                       |
+======================================================================+



See also:
  http://ente.limmat.ch/linux/exim_v3_-_amavisd-new.html
  http://bugs.debian.org/213422


How To Use AMaViS With exim
***************************


Exim 3.x
********

Scanning incoming mail only
===========================

First of all, create the group "amavis" and the user "amavis", which
is in this group. Add the user amavis to your trusted users, so in the
MAIN CONFIGURATION SETTINGS add the following line

trusted_users = amavis

(or, if this line already exists simply add amavis, separated with a
colon).

In the TRANSPORT CONFIGURATION, add the following:

amavis:
   driver = smtp
   port = 10024
   hosts = 127.0.0.1
   allow_localhost

Here below is an old variant of a transport which uses a pipe to a helper
program amavis(.c). As feeding to amavisd-new with SMTP is easier and
possibly faster, the pipe via helper setup is not recommended - it is
included here for the curious:

# amavis:
#   driver = pipe
#   command = "/usr/sbin/amavis <${sender_address}> ${pipe_addresses}"
#   prefix =
#   suffix =
#   check_string =
#   escape_string =
# # for debugging change return_output to true
#   return_output = false
#   return_path_add = false
#   user = amavis
#   group = amavis
#   path = "/bin:/sbin:/usr/bin:/usr/sbin"
#   current_directory = "/var/amavis"

At the *beginning* of the DIRECTORS CONFIGURATION, add the following:

amavis_director:
  condition = "${if eq {$received_protocol}{scanned-ok} {0}{1}}"
  driver = smartuser
  transport = amavis
  # verify must be set to false, to avoid troubles with receiver and/or
  # sender verify
  verify = false


NOTE: Please keep in mind that the ORDER matters!

Scanning incoming/outgoing and relayed mail
===========================================

Scanning of outgoing mail is also possible (based on a contribution
by John Burnham).

Additionally to the steps mentioned at the "Scanning incoming mail only"
section, do the following:

At the *beginning* of the ROUTERS CONFIGURATION, add the following

amavis_router:
  condition = "${if eq {$received_protocol}{scanned-ok} {0}{1}}"
  driver = domainlist
  route_list = "*"
  transport = amavis
  # verify must be set to false, to avoid troubles with receiver and/or
  # sender verify
  verify = false



The configure script should be called with the option
--enable-exim. Well, it is enabled by default if the MTA qmail is not
installed on the system.

NOTE: if the MTA qmail is installed on your system, too, you *MUST*
add --disable-qmail

NOTE: do not forget to set up an (eMail) alias for "amavis" to a real
user account. If you used --with-notifyreceivers, and a user sends a
mail to an non-existent remote user, the bounce message from the
remote MTA will be send to pseudo-user amavis.

Note: If you want to add a "X-Virus-Scanned" header you can do this in
your exim configuration, too. Use the headers_add option in the
amavis TRANSPORT CONFIGURATION, i.e.  headers_add =
"X-Virus-Scanned: by AMaViS (<a href="http://amavis.org/">http://amavis.org/</a>)"


Exim 4.x
********

+======================================================================+
| (Please see instructions in README.exim_v4. The setup described here |
| is not recommended with amavisd-new + Exim v4)                       |
+======================================================================+


The setup is very similar to the Exim 3.x one, so you should read
this section first.


# trusted users
trusted_users = amavis


Routers configuration:
# in routers:

amavis_router:
  condition = "${if eq {$received_protocol}{scanned-ok} {0}{1}}"
  driver = accept
  transport = amavis
  # verify must be set to false, to avoid troubles with receiver and/or
  # sender verify
  verify = false


Transport configuration:

After the

remote_smtp:
  driver = smtp

entry, add the following entry

amavis:
   driver = smtp
   port = 10024
   hosts = 127.0.0.1
   allow_localhost

Or the old variant via pipe to amavis(.c) helper program (not recommended):

# amavis:
#   driver = pipe
#   command = "/usr/sbin/amavis <${sender_address}> ${pipe_addresses}"
# # for debugging change return_output to true
#   return_output = false
#   return_path_add = false
#   user = amavis
#   group = amavis
#   path = "/bin:/sbin:/usr/bin:/usr/sbin"
#   current_directory = "/var/amavis"


(based on a mail to exim-users by Niels Dettenbach)


AMaViS via exim system filter
*****************************

This setup has not been tested by the AMaViS team yet. Feedback on this
is very welcome! Based on a mail from Dariusz Sznajder to the amavis-
user mailing list (<a href="http://marc.theaimsgroup.com/?l=amavis-user">http://marc.theaimsgroup.com/?l=amavis-user</a>&amp;m=102861263206738&amp;w=2)

In exim/configure I have:
	[...]
	system_filter = /etc/exim.filter
	system_filter_pipe_transport = amavis_pipe

	[...]
	amavis_pipe:
	  driver = pipe
	  user = amavis
	  return_output
	  headers_add = ${if def:authenticated_id {X-Authenticated-Sender: $authenticated_id}{}}

	[...]

/etc/exim.filter
	# Exim filter

	# drop out error messages here
	if $received_protocol is "scanned-ok"
	then
	    finish
	endif

	pipe "/usr/sbin/amavis \"$sender_address\" \"$recipients\""


AMaViS has to be configured as ./configure --enable-exim



FAQ
---

Q: Whenever I am receiving many mails in large batches (i.e. via
UUCP or fetchmail), the system load on the machine on which AMaViS
runs climbs to a level that renders the machine virtually unusable.
How do I prevent such behaviour?

A: The reason for the high load is that one AMaViS process (and in
turn AMaViS' children processes) are started for every message that is
received. The obvious solution is to limit the number of AMaViS
processes that are started simultaniously.

AMaViS does not currently support this itself, but every sensible MTA
does. Moreover, it makes sense to limit the number of messages that an
MTA can deliver at one time, to prevent mail server death by spamming.

For Exim, the configuration keywords to look for are deliver_load_max,
deliver_queue_load_max, and queue_only_load which control whether
mails are delivered (read: passed to AMaViS) or queued only under high
load. More detailed information can be found in the Exim
Specification.


Credits
-------
Philip Hazel, Marc Haber, John Burnham, Jeffrey C. Ollie, Hilko Bengen,
Niels Dettenbach, Dariusz Sznajder


TODO
----

* whatever you whish to add here :-)

Author
------
Rainer Link
eMail: <a href="mailto:Rainer.Link@suse.de">Rainer.Link@suse.de</a>
WWW: <a href="http://rainer.w3.to">http://rainer.w3.to</a>

Please send bug reports, questions, suggestions and more directly to
the author. Thanks :-)

Updated by Mark Martinec, based on suggestion
in http://bugs.debian.org/213422 from Enrico