Added original config files.
[carnet-upgrade.git] / usr / share / carnet-upgrade / files / etc / amavis / amavisd.conf
1 use strict;
2
3 # Configuration file for amavisd-new
4 # Defaults modified for the Debian amavisd-new package
5 # $Id: amavisd.conf,v 1.27.2.2 2004/11/18 23:27:55 hmh Exp $
6 #
7 # This software is licensed under the GNU General Public License (GPL).
8 # See comments at the start of amavisd-new for the whole license text.
9
10 #Sections:
11 # Section I    - Essential daemon and MTA settings
12 # Section II   - MTA specific
13 # Section III  - Logging
14 # Section IV   - Notifications/DSN, BOUNCE/REJECT/DROP/PASS destiny, quarantine
15 # Section V    - Per-recipient and per-sender handling, whitelisting, etc.
16 # Section VI   - Resource limits
17 # Section VII  - External programs, virus scanners, SpamAssassin
18 # Section VIII - Debugging
19
20 #GENERAL NOTES:
21 #  This file is a normal Perl code, interpreted by Perl itself.
22 #  - make sure this file (or directory where it resides) is NOT WRITABLE
23 #    by mere mortals (not even vscan/amavis; best to make it owned by root),
24 #    otherwise it represents a severe security risk!
25 #  - for values which are interpreted as booleans, it is recommended
26 #    to use 1 for true, undef for false.
27 #    THIS IS DIFFERENT FROM OLD AMAVIS VERSIONS where "no" also meant false,
28 #    now it means true, like any nonempty string does!
29 #  - Perl syntax applies. Most notably: strings in "" may include variables
30 #    (which start with $ or @); to include characters @ and $ in double
31 #    quoted strings, precede them by a backslash; in single-quoted strings
32 #    the $ and @ lose their special meaning, so it is usually easier to use
33 #    single quoted strings (or qw operator) for e-mail addresses.
34 #    Still, in both cases a backslash needs to be doubled.
35 #  - variables with names starting with a '@' are lists, the values assigned
36 #    to them should be lists as well, e.g. ('one@foo', $mydomain, "three");
37 #    note the comma-separation and parenthesis. If strings in the list
38 #    do not contain spaces nor variables, a Perl operator qw() may be used
39 #    as a shorthand to split its argument on whitespace and produce a list
40 #    of strings, e.g. qw( one@foo example.com three );  Note that the argument
41 #    to qw is quoted implicitly and no variable interpretation is done within
42 #    (no '$' variable evaluations). The #-initiated comments can NOT be used
43 #    within a string. In other words, $ and # lose their special meaning
44 #    within a qw argument, just like within '...' strings.
45 #  - all e-mail addresses in this file and as used internally by the daemon
46 #    are in their raw (rfc2821-unquoted and non-bracketed) form, i.e. 
47 #    Bob "Funny" Dude@example.com, not: "Bob \"Funny\" Dude"@example.com
48 #    and not <"Bob \"Funny\" Dude"@example.com>; also: '' and not '<>'.
49 #  - the term 'default value' in examples below refers to the value of a
50 #    variable pre-assigned to it by the program; any explicit assignment
51 #    to a variable in this configuration file overrides the default value;
52
53
54 #
55 # Section I - Essential daemon and MTA settings
56 #
57
58 # $MYHOME serves as a quick default for some other configuration settings.
59 # More refined control is available with each individual setting further down.
60 # $MYHOME is not used directly by the program. No trailing slash!
61 $MYHOME = '/var/lib/amavis';   # (default is '/var/amavis')
62
63 # $mydomain serves as a quick default for some other configuration settings.
64 # More refined control is available with each individual setting further down.
65 # $mydomain is never used directly by the program.
66 $mydomain = 'example.com';      # (no useful default)
67
68 # $myhostname = 'host.example.com';  # fqdn of this host, default by uname(3)
69
70 # Set the user and group to which the daemon will change if started as root
71 # (otherwise just keeps the UID unchanged, and these settings have no effect):
72 $daemon_user  = 'amavis';       # (no default (undef))
73 $daemon_group = 'amavis';       # (no default (undef))
74
75 # Runtime working directory (cwd), and a place where
76 # temporary directories for unpacking mail are created.
77 # if you change this, you might want to modify the cleanup()
78 # function in /etc/init.d/amavisd-new
79 # (no trailing slash, may be a scratch file system)
80 $TEMPBASE = $MYHOME;           # (must be set if other config vars use is)
81 #$TEMPBASE = "$MYHOME/tmp";     # prefer to keep home dir /var/amavis clean?
82
83 # $helpers_home sets environment variable HOME, and is passed as option
84 # 'home_dir_for_helpers' to Mail::SpamAssassin::new. It should be a directory
85 # on a normal persistent file system, not a scratch or temporary file system
86 #$helpers_home = $MYHOME;      # (defaults to $MYHOME)
87
88 # Run the daemon in the specified chroot jail if nonempty:
89 #$daemon_chroot_dir = $MYHOME;  # (default is undef, meaning: do not chroot)
90
91 $pid_file  = "/var/run/amavis/amavisd.pid";  # (default: "$MYHOME/amavisd.pid")
92 $lock_file = "/var/run/amavis/amavisd.lock"; # (default: "$MYHOME/amavisd.lock")
93
94 # set environment variables if you want (no defaults):
95 $ENV{TMPDIR} = $TEMPBASE;       # wise to set TMPDIR, but not obligatory
96 #...
97
98
99 # MTA SETTINGS, UNCOMMENT AS APPROPRIATE,
100 # both $forward_method and $notify_method default to 'smtp:127.0.0.1:10025'
101
102 # POSTFIX, or SENDMAIL in dual-MTA setup, or EXIM V4
103 # (set host and port number as required; host can be specified
104 # as IP address or DNS name (A or CNAME, but MX is ignored)
105 #$forward_method = 'smtp:127.0.0.1:10025';  # where to forward checked mail
106 #$notify_method = $forward_method;          # where to submit notifications
107
108 # NOTE: The defaults (above) are good for Postfix or dual-sendmail. You MUST
109 #       uncomment the appropriate settings below if using other setups!
110
111 # SENDMAIL MILTER, using amavis-milter.c helper program:
112 # SEE amavisd-new-milter package docs FOR DEBIAN INSTRUCTIONS
113 #$forward_method = undef;  # no explicit forwarding, sendmail does it by itself
114 # milter; option -odd is needed to avoid deadlocks
115 #$notify_method = 'pipe:flags=q argv=/usr/sbin/sendmail -Ac -i -odd -f ${sender} -- ${recipient}';
116 # just a thought: can we use use -Am instead of -odd ?
117
118 # SENDMAIL (old non-milter setup, as relay):
119 #$forward_method = 'pipe:flags=q argv=/usr/sbin/sendmail -C/etc/sendmail.orig.cf -i -f ${sender} -- ${recipient}';
120 #$notify_method = $forward_method;
121
122 # SENDMAIL (old non-milter setup, amavis.c calls local delivery agent):
123 #$forward_method = undef;  # no explicit forwarding, amavis.c will call LDA
124 #$notify_method = 'pipe:flags=q argv=/usr/sbin/sendmail -Ac -i -f ${sender} -- ${recipient}';
125
126 # EXIM v3 (not recommended with v4 or later, which can use SMTP setup instead):
127 #$forward_method = 'pipe:flags=q argv=/usr/sbin/exim -oMr scanned-ok -i -f ${sender} -- ${recipient}';
128 #$notify_method = $forward_method;
129
130 # prefer to collect mail for forwarding as BSMTP files?
131 #$forward_method = "bsmtp:$MYHOME/out-%i-%n.bsmtp";
132 #$notify_method = $forward_method;
133
134
135 # Net::Server pre-forking settings
136 # You may want $max_servers to match the width of your MTA pipe
137 # feeding amavisd, e.g. with Postfix the 'Max procs' field in the
138 # master.cf file, like the '2' in the:  smtp-amavis unix - - n - 2 smtp
139 #
140 $max_servers  =  2;   # number of pre-forked children          (default 2)
141 $max_requests = 10;   # retire a child after that many accepts (default 10)
142
143 $child_timeout=5*60;  # abort child if it does not complete each task in n sec
144                       # (default: 8*60 seconds)
145
146 # Check also the settings of @av_scanners at the end if you want to use
147 # virus scanners. If not, you may want to delete the whole long assignment
148 # to the variable @av_scanners, which will also remove the virus checking
149 # code (e.g. if you only want to do spam scanning).
150
151 # Here is a QUICK WAY to completely DISABLE some sections of code
152 # that WE DO NOT WANT (it won't even be compiled-in).
153 # For more refined controls leave the following two lines commented out,
154 # and see further down what these two lookup lists really mean.
155 #
156 # @bypass_virus_checks_acl = qw( . );  # uncomment to DISABLE anti-virus code
157 # @bypass_spam_checks_acl  = qw( . );  # uncomment to DISABLE anti-spam code
158 #
159 # Any setting can be changed with a new assignment, so make sure
160 # you do not unintentionally override these settings further down!
161 @bypass_spam_checks_acl  = qw( . );    # No default dependency on spamassassin
162
163 # Lookup list of local domains (see README.lookups for syntax details)
164 #
165 # NOTE:
166 #   For backwards compatibility the variable names @local_domains (old) and
167 #   @local_domains_acl (new) are synonyms. For consistency with other lookups
168 #   the name @local_domains_acl is now preferred. It also makes it more
169 #   obviously distinct from the new %local_domains hash lookup table.
170 #
171 # local_domains* lookup tables are used in deciding whether a recipient
172 # is local or not, or in other words, if the message is outgoing or not.
173 # This affects inserting spam-related headers for local recipients,
174 # limiting recipient virus notifications (if enabled) to local recipients,
175 # in deciding if address extension may be appended, and in SQL lookups
176 # for non-fqdn addresses. Set it up correctly if you need features
177 # that rely on this setting (or just leave empty otherwise).
178 #
179 # With Postfix (2.0) a quick reminder on what local domains normally are:
180 # a union of domains specified in: $mydestination, $virtual_alias_domains,
181 # $virtual_mailbox_domains, and $relay_domains.
182 #
183 @local_domains_acl = ( ".$mydomain" );  # $mydomain and its subdomains
184 # @local_domains_acl = ( ".$mydomain", "my.other.domain" );
185 # @local_domains_acl = qw();  # default is empty, no recipient treated as local
186 # @local_domains_acl = qw( .example.com );
187 # @local_domains_acl = qw( .example.com !host.sub.example.net .sub.example.net );
188
189 # or alternatively(A), using a Perl hash lookup table, which may be assigned
190 # directly, or read from a file, one domain per line; comments and empty lines
191 # are ignored, a dot before a domain name implies its subdomains:
192 #
193 #read_hash(\%local_domains, '/etc/amavis/local_domains');
194
195 #or alternatively(B), using a list of regular expressions:
196 # $local_domains_re = new_RE( qr'[@.]example\.com$'i );
197 #
198 # see README.lookups for syntax and semantics
199
200
201 #
202 # Section II - MTA specific (defaults should be ok)
203 #
204
205 # if $relayhost_is_client is true, the IP address in $notify_method and
206 # $forward_method is dynamically overridden with SMTP client peer address
207 # (if available), which makes it possible for several hosts to share one 
208 # daemon.  The static port number is also overridden, and is dynamically 
209 # calculated  as being one above the incoming SMTP/LMTP session port number.
210 #
211 # These are logged at level 3, so enable logging until you know you got it
212 # right.
213 $relayhost_is_client = 0;         # (defaults to false)
214
215 $insert_received_line = 1;        # behave like MTA: insert 'Received:' header
216                                   # (does not apply to sendmail/milter)
217                                   # (default is true (1) )
218
219 # AMAVIS-CLIENT PROTOCOL INPUT SETTINGS (e.g. with sendmail milter)
220 #   (used with amavis helper clients like amavis-milter.c and amavis.c,
221 #   NOT needed for Postfix and Exim  or dual-sendmail - keep it undefined.)
222 #$unix_socketname = "/var/lib/amavis/amavisd.sock"; # amavis helper protocol socket
223 $unix_socketname = undef;         # disable listening on a unix socket
224                                   # (default is undef, i.e. disabled)
225
226 # Do we receive quoted or raw addresses from the helper program?
227 # (does not apply to SMTP;  defaults to true)
228 #$gets_addr_in_quoted_form = 1;   # "Bob \"Funny\" Dude"@example.com
229 #$gets_addr_in_quoted_form = 0;   # Bob "Funny" Dude@example.com
230
231
232
233 # SMTP SERVER (INPUT) PROTOCOL SETTINGS (e.g. with Postfix, Exim v4, ...)
234 #   (used when MTA is configured to pass mail to amavisd via SMTP or LMTP)
235 $inet_socket_port = 10024;        # accept SMTP on this local TCP port
236                                   # (default is undef, i.e. disabled)
237 # multiple ports may be provided: $inet_socket_port = [10024, 10026, 10028];
238
239 # SMTP SERVER (INPUT) access control
240 # - do not allow free access to the amavisd SMTP port !!!
241 #
242 # when MTA is at the same host, use the following (one or the other or both):
243 $inet_socket_bind = '127.0.0.1';  # limit socket bind to loopback interface
244                                   # (default is '127.0.0.1')
245 @inet_acl = qw( 127.0.0.1 );      # allow SMTP access only from localhost IP
246                                   # (default is qw( 127.0.0.1 ) )
247
248 # when MTA (one or more) is on a different host, use the following:
249 # @inet_acl = qw(127/8 10.1.0.1 10.1.0.2);  # adjust the list as appropriate
250 # $inet_socket_bind = undef;      # bind to all IP interfaces if undef
251 #
252 # Example1:
253 # @inet_acl = qw( 127/8 10/8 172.16/12 192.168/16 );
254 # permit only SMTP access from loopback and rfc1918 private address space
255 #
256 # Example2:
257 # @inet_acl = qw( !192.168.1.12 172.16.3.3 !172.16.3/255.255.255.0
258 #                 127.0.0.1 10/8 172.16/12 192.168/16 );
259 # matches loopback and rfc1918 private address space except host 192.168.1.12
260 # and net 172.16.3/24 (but host 172.16.3.3 within 172.16.3/24 still matches)
261 #
262 # Example3:
263 # @inet_acl = qw( 127/8
264 #                 !172.16.3.0   !172.16.3.127 172.16.3.0/25
265 #                 !172.16.3.128 !172.16.3.255 172.16.3.128/25 );
266 # matches loopback and both halves of the 172.16.3/24 C-class,
267 # split into two subnets, except all four broadcast addresses
268 # for these subnets
269 #
270 # See README.lookups for details on specifying access control lists.
271
272
273 #
274 # Section III - Logging
275 #
276
277 # true (e.g. 1) => syslog;  false (e.g. 0) => logging to file
278 $DO_SYSLOG = 1;                 # (defaults to false)
279 #$SYSLOG_LEVEL = 'user.info';     # (facility.priority, default 'mail.info')
280
281 # Log file (if not using syslog)
282 $LOGFILE = "/var/log/amavis.log";  # (defaults to empty, no log)
283
284 #NOTE: levels are not strictly observed and are somewhat arbitrary
285 # 0: startup/exit/failure messages, viruses detected
286 # 1: args passed from client, some more interesting messages
287 # 2: virus scanner output, timing
288 # 3: server, client
289 # 4: decompose parts
290 # 5: more debug details
291 #$log_level = 2;                # (defaults to 0)
292
293 # Customizable template for the most interesting log file entry (e.g. with
294 # $log_level=0) (take care to properly quote Perl special characters like '\')
295 # For a list of available macros see README.customize .
296
297 # only log infected messages (useful with log level 0):
298 # $log_templ = '[? %#V |[? %#F ||banned filename ([%F|,])]|infected ([%V|,])]#
299 # [? %#V |[? %#F ||, from=[?%o|(?)|<%o>], to=[<%R>|,][? %i ||, quarantine %i]]#
300 # |, from=[?%o|(?)|<%o>], to=[<%R>|,][? %i ||, quarantine %i]]';
301
302 # log both infected and noninfected messages (default):
303 $log_templ = '[? %#V |[? %#F |[?%#D|Not-Delivered|Passed]|BANNED name/type (%F)]|INFECTED (%V)], #
304 [?%o|(?)|<%o>] -> [<%R>|,][? %i ||, quarantine %i], Message-ID: %m, Hits: %c';
305
306
307 #
308 # Section IV - Notifications/DSN, BOUNCE/REJECT/DROP/PASS destiny, quarantine
309 #
310
311 # Select notifications text encoding when Unicode-aware Perl is converting
312 # text from internal character representation to external encoding (charset
313 # in MIME terminology). Used as argument to Perl Encode::encode subroutine.
314 #
315 #   to be used in RFC 2047-encoded header field bodies, e.g. in Subject:
316 #$hdr_encoding = 'iso-8859-1';  # (default: 'iso-8859-1')
317 #
318 #   to be used in notification body text: its encoding and Content-type.charset
319 #$bdy_encoding = 'iso-8859-1';  # (default: 'iso-8859-1')
320
321 # Default template texts for notifications may be overruled by directly
322 # assigning new text to template variables, or by reading template text
323 # from files. A second argument may be specified in a call to read_text(),
324 # specifying character encoding layer to be used when reading from the
325 # external file, e.g. 'utf8', 'iso-8859-1', or often just $bdy_encoding.
326 # Text will be converted to internal character representation by Perl 5.8.0
327 # or later; second argument is ignored otherwise. See PerlIO::encoding,
328 # Encode::PerlIO and perluniintro man pages.
329 #
330 # $notify_sender_templ      = read_text('/var/amavis/notify_sender.txt');
331 # $notify_virus_sender_templ= read_text('/var/amavis/notify_virus_sender.txt');
332 # $notify_virus_admin_templ = read_text('/var/amavis/notify_virus_admin.txt');
333 # $notify_virus_recips_templ= read_text('/var/amavis/notify_virus_recips.txt');
334 # $notify_spam_sender_templ = read_text('/var/amavis/notify_spam_sender.txt');
335 # $notify_spam_admin_templ  = read_text('/var/amavis/notify_spam_admin.txt');
336
337 # If notification template files are collectively available in some directory,
338 # use read_l10n_templates which calls read_text for each known template.
339 #
340 #   read_l10n_templates('/etc/amavis/en_US');
341 #
342 # Debian available locales: en_US, pt_BR, de_DE, it_IT
343 read_l10n_templates('en_US', '/etc/amavis');
344
345
346 # Here is an overall picture (sequence of events) of how pieces fit together
347 # (only virus controls are shown, spam controls work the same way):
348 #
349 #   bypass_virus_checks? ==> PASS
350 #   no viruses?   ==> PASS
351 #   log virus     if $log_templ is nonempty
352 #   quarantine    if $virus_quarantine_to is nonempty
353 #   notify admin  if $virus_admin (lookup) nonempty
354 #   notify recips if $warnvirusrecip and (recipient is local or $warn_offsite)
355 #   add address extensions if adding extensions is enabled and virus will pass
356 #   send (non-)delivery notifications
357 #      to sender if DSN needed (BOUNCE or ($warn_virus_sender and D_PASS))
358 #   virus_lovers or final_destiny==D_PASS  ==> PASS
359 #   DISCARD (2xx) or REJECT (5xx) (depending on final_*_destiny)
360 #
361 # Equivalent flow diagram applies for spam checks.
362 # If a virus is detected, spam checking is skipped entirely.
363
364 # The following symbolic constants can be used in *destiny settings:
365 #
366 # D_PASS     mail will pass to recipients, regardless of bad contents;
367 #
368 # D_DISCARD  mail will not be delivered to its recipients, sender will NOT be
369 #            notified. Effectively we lose mail (but will be quarantined
370 #            unless disabled). Losing mail is not decent for a mailer,
371 #            but might be desired.
372 #
373 # D_BOUNCE   mail will not be delivered to its recipients, a non-delivery
374 #            notification (bounce) will be sent to the sender by amavisd-new;
375 #            Exception: bounce (DSN) will not be sent if a virus name matches
376 #            $viruses_that_fake_sender_re, or to messages from mailing lists
377 #            (Precedence: bulk|list|junk);
378 #
379 # D_REJECT   mail will not be delivered to its recipients, sender should
380 #            preferably get a reject, e.g. SMTP permanent reject response
381 #            (e.g. with milter), or non-delivery notification from MTA
382 #            (e.g. Postfix). If this is not possible (e.g. different recipients
383 #            have different tolerances to bad mail contents and not using LMTP)
384 #            amavisd-new sends a bounce by itself (same as D_BOUNCE).
385 #
386 # Notes:
387 #   D_REJECT and D_BOUNCE are similar, the difference is in who is responsible
388 #            for informing the sender about non-delivery, and how informative
389 #            the notification can be (amavisd-new knows more than MTA);
390 #   With D_REJECT, MTA may reject original SMTP, or send DSN (delivery status
391 #            notification, colloquially called 'bounce') - depending on MTA;
392 #            Best suited for sendmail milter, especially for spam.
393 #   With D_BOUNCE, amavisd-new (not MTA) sends DSN (can better explain the
394 #            reason for mail non-delivery, but unable to reject the original
395 #            SMTP session). Best suited to reporting viruses, and for Postfix
396 #            and other dual-MTA setups, which can't reject original client SMTP
397 #            session, as the mail has already been enqueued.
398
399 $final_virus_destiny      = D_DISCARD; # (defaults to D_BOUNCE)
400 $final_banned_destiny     = D_BOUNCE;  # (defaults to D_BOUNCE)
401 $final_spam_destiny       = D_REJECT;  # (defaults to D_REJECT)
402 $final_bad_header_destiny = D_PASS;  # (defaults to D_PASS), D_BOUNCE suggested
403
404 # Alternatives to consider for spam:
405 # - use D_PASS if clients will do filtering based on inserted mail headers;
406 # - use D_DISCARD, if kill_level is set safely high;
407 # - use D_BOUNCE instead of D_REJECT if not using milter;
408 #
409 # D_BOUNCE is preferred for viruses, but consider:
410 # - use D_DISCARD to avoid bothering the rest of the network, it is hopeless
411 #   to try to keep up with the viruses that faker the envelope sender anyway,
412 #   and bouncing only increases the network cost of viruses for everyone
413 # - use D_PASS (or virus_lovers) and $warnvirussender=1 to deliver viruses;
414 # - use D_REJECT instead of D_BOUNCE if using milter and under heavy
415 #   virus storm;
416 #
417 # Don't bother to set both D_DISCARD and $warn*sender=1, it will get mapped
418 # to D_BOUNCE.
419 #
420 # The separation of *_destiny values into D_BOUNCE, D_REJECT, D_DISCARD
421 # and D_PASS made settings $warnvirussender and $warnspamsender only still
422 # useful with D_PASS.
423
424 # The following $warn*sender settings are ONLY used when mail is
425 # actually passed to recipients ($final_*_destiny=D_PASS, or *_lovers*).
426 # Bounces or rejects produce non-delivery status notification anyway.
427
428 # Notify virus sender?
429 #$warnvirussender = 1;  # (defaults to false (undef))
430
431 # Notify spam sender?
432 #$warnspamsender = 1;   # (defaults to false (undef))
433
434 # Notify sender of banned files?
435 #$warnbannedsender = 1; # (defaults to false (undef))
436
437 # Notify sender of syntactically invalid header containing non-ASCII characters?
438 #$warnbadhsender = 1;   # (defaults to false (undef))
439
440 # Notify virus (or banned files) RECIPIENT?
441 #  (not very useful, but some policies demand it)
442 #$warnvirusrecip = 1;   # (defaults to false (undef))
443 #$warnbannedrecip = 1;  # (defaults to false (undef))
444
445 # Notify also non-local virus/banned recipients if $warn*recip is true?
446 #  (including those not matching local_domains*)
447 #$warn_offsite = 1;    # (defaults to false (undef), i.e. only notify locals)
448
449
450 # Treat envelope sender address as unreliable and don't send sender
451 # notification / bounces if name(s) of detected virus(es) match the list.
452 # Note that virus names are supplied by external virus scanner(s) and are
453 # not standardized, so virus names may need to be adjusted.
454 # See README.lookups for syntax, check also README.policy-on-notifications
455 #
456 $viruses_that_fake_sender_re = new_RE(
457   qr'nimda|hybris|klez|bugbear|yaha|braid|sobig|fizzer|palyh|peido|holar'i,
458   qr'tanatos|lentin|bridex|mimail|trojan\.dropper|dumaru|parite|spaces'i,
459   qr'dloader|galil|gibe|swen|netwatch|bics|sbrowse|sober|rox|val(hal)?la'i,
460   qr'frethem|sircam|be?agle|tanx|mydoom|novarg|shimg|netsky|somefool|moodown'i,
461   qr'@mm|@MM',    # mass mailing viruses as labeled by f-prot and uvscan
462   qr'Worm'i,      # worms as labeled by ClamAV, Kaspersky, etc
463   [qr'^(EICAR|Joke\.|Junk\.)'i         => 0],
464   [qr'^(WM97|OF97|W95/CIH-|JS/Fort)'i  => 0],
465   [qr/.*/ => 1],  # true by default  (remove or comment-out if undesired)
466 );
467
468 # where to send ADMIN VIRUS NOTIFICATIONS (should be a fully qualified address)
469 # - the administrator address may be a simple fixed e-mail address (a scalar),
470 #   or may depend on the SENDER address (e.g. its domain), in which case
471 #   a ref to a hash table can be specified (specify lower-cased keys,
472 #   dot is a catchall, see README.lookups).
473 #
474 #   Empty or undef lookup disables virus admin notifications.
475
476 # $virus_admin = undef;   # do not send virus admin notifications (default)
477 # $virus_admin = {'not.example.com' => '', '.' => 'virusalert@example.com'};
478 # $virus_admin = 'virus-admin@example.com';
479 $virus_admin = "postmaster\@$mydomain";         # due to D_DISCARD default
480
481 # equivalent to $virus_admin, but for spam admin notifications:
482 # $spam_admin = "spamalert\@$mydomain";
483 # $spam_admin = undef;    # do not send spam admin notifications (default)
484 # $spam_admin = {'not.example.com' => '', '.' => 'spamalert@example.com'};
485
486 #advanced example, using a hash lookup table:
487 #$virus_admin = {
488 # 'baduser@sub1.example.com' => 'HisBoss@sub1.example.com',
489 # '.sub1.example.com'  => 'virusalert@sub1.example.com',
490 # '.sub2.example.com'  => '',                  # don't send admin notifications
491 # 'a.sub3.example.com' => 'abuse@sub3.example.com',
492 # '.sub3.example.com'  => 'virusalert@sub3.example.com',
493 # '.example.com'       => 'noc@example.com',   # catchall for our virus senders
494 # '.'                  => 'virusalert@hq.example.com',  # catchall for the rest
495 #};
496
497
498 # whom notification reports are sent from (ENVELOPE SENDER);
499 # may be a null reverse path, or a fully qualified address:
500 #   (admin and recip sender addresses default to $mailfrom
501 #   for compatibility, which in turn defaults to undef (empty) )
502 #   If using strings in double quotes, don't forget to quote @, i.e. \@
503 #
504 #$mailfrom_notify_admin     = "virusalert\@$mydomain";
505 #$mailfrom_notify_recip     = "virusalert\@$mydomain";
506 #$mailfrom_notify_spamadmin = "spam.police\@$mydomain";
507
508 # 'From' HEADER FIELD for sender and admin notifications.
509 # This should be a replyable address, see rfc1894. Not to be confused
510 # with $mailfrom_notify_sender, which is the envelope return address
511 # and should be empty (null reverse path) according to rfc2821.
512 #
513 # The syntax of the 'From' header field is specified in rfc2822, section
514 # '3.4. Address Specification'. Note in particular that display-name must be
515 # a quoted-string if it contains any special characters like spaces and dots.
516 #
517 # $hdrfrom_notify_sender = "amavisd-new <postmaster\@$mydomain>";
518 # $hdrfrom_notify_sender = 'amavisd-new <postmaster@example.com>';
519 # $hdrfrom_notify_sender = '"Content-Filter Master" <postmaster@example.com>';
520 #   (defaults to: "amavisd-new <postmaster\@$myhostname>")
521 # $hdrfrom_notify_admin = $mailfrom_notify_admin;
522 #   (defaults to: $mailfrom_notify_admin)
523 # $hdrfrom_notify_spamadmin = $mailfrom_notify_spamadmin;
524 #   (defaults to: $mailfrom_notify_spamadmin)
525
526 # whom quarantined messages appear to be sent from (envelope sender);
527 # keeps original sender if undef, or set it explicitly, default is undef
528 $mailfrom_to_quarantine = '';   # override sender address with null return path
529
530
531 # Location to put infected mail into: (applies to 'local:' quarantine method)
532 #   empty for not quarantining, may be a file (mailbox),
533 #   or a directory (no trailing slash)
534 #   (the default value is undef, meaning no quarantine)
535 #
536 $QUARANTINEDIR = '/var/lib/amavis/virusmails';
537
538 #$virus_quarantine_method = "local:virus-%i-%n";    # default
539 #$spam_quarantine_method  = "local:spam-%b-%i-%n";  # default
540 #
541 #use the new 'bsmtp:' method as an alternative to the default 'local:'
542 #$virus_quarantine_method = "bsmtp:$QUARANTINEDIR/virus-%i-%n.bsmtp";
543 #$spam_quarantine_method  = "bsmtp:$QUARANTINEDIR/spam-%b-%i-%n.bsmtp";
544
545 # When using the 'local:' quarantine method (default), the following applies:
546 #
547 # A finer control of quarantining is available through variable
548 # $virus_quarantine_to/$spam_quarantine_to. It may be a simple scalar string,
549 # or a ref to a hash lookup table, or a regexp lookup table object,
550 # which makes possible to set up per-recipient quarantine addresses.
551 #
552 # The value of scalar $virus_quarantine_to/$spam_quarantine_to (or a
553 # per-recipient lookup result from the hash table %$virus_quarantine_to)
554 # is/are interpreted as follows:
555 #
556 # VARIANT 1:
557 #   empty or undef disables quarantine;
558 #
559 # VARIANT 2:
560 #   a string NOT containing an '@';
561 # amavisd will behave as a local delivery agent (LDA) and will quarantine
562 # viruses to local files according to hash %local_delivery_aliases (pseudo
563 # aliases map) - see subroutine mail_to_local_mailbox() for details.
564 # Some of the predefined aliases are 'virus-quarantine' and 'spam-quarantine'.
565 # Setting $virus_quarantine_to ($spam_quarantine_to) to this string will:
566 #
567 # * if $QUARANTINEDIR is a directory, each quarantined virus will go
568 #   to a separate file in the $QUARANTINEDIR directory (traditional
569 #   amavis style, similar to maildir mailbox format);
570 #
571 # * otherwise $QUARANTINEDIR is treated as a file name of a Unix-style
572 #   mailbox. All quarantined messages will be appended to this file.
573 #   Amavisd child process must obtain an exclusive lock on the file during
574 #   delivery, so this may be less efficient than using individual files
575 #   or forwarding to MTA, and it may not work across NFS or other non-local
576 #   file systems (but may be handy for pickup of quarantined files via IMAP
577 #   for example);
578 #
579 # VARIANT 3:
580 #   any email address (must contain '@').
581 # The e-mail messages to be quarantined will be handed to MTA
582 # for delivery to the specified address. If a recipient address local to MTA
583 # is desired, you may leave the domain part empty, e.g. 'infected@', but the
584 # '@' character must nevertheless be included to distinguish it from variant 2.
585 #
586 # This method enables more refined delivery control made available by MTA
587 # (e.g. its aliases file, other local delivery agents, dealing with
588 # privileges and file locking when delivering to user's mailbox, nonlocal
589 # delivery and forwarding, fan-out lists). Make sure the mail-to-be-quarantined
590 # will not be handed back to amavisd for checking, as this will cause a loop
591 # (hopefully broken at some stage)! If this can be assured, notifications
592 # will benefit too from not being unnecessarily virus-scanned.
593 #
594 # By default this is safe to do with Postfix and Exim v4 and dual-sendmail
595 # setup, but probably not safe with sendmail milter interface without
596 # precaution.
597
598 # (the default value is undef, meaning no quarantine)
599
600 $virus_quarantine_to  = 'virus-quarantine';    # traditional local quarantine
601 #$virus_quarantine_to = 'infected@';           # forward to MTA for delivery
602 #$virus_quarantine_to = "virus-quarantine\@$mydomain";   # similar
603 #$virus_quarantine_to = 'virus-quarantine@example.com';  # similar
604 #$virus_quarantine_to = undef;                 # no quarantine
605 #
606 #$virus_quarantine_to = new_RE(                # per-recip multiple quarantines
607 #  [qr'^user@example\.com$'i => 'infected@'],
608 #  [qr'^(.*)@example\.com$'i => 'virus-${1}@example.com'],
609 #  [qr'^(.*)(@[^@])?$'i      => 'virus-${1}${2}'],
610 #  [qr/.*/                   => 'virus-quarantine'] );
611
612 # similar for spam
613 # (the default value is undef, meaning no quarantine)
614 #
615 $spam_quarantine_to = 'spam-quarantine';
616 #$spam_quarantine_to = "spam-quarantine\@$mydomain";
617 #$spam_quarantine_to = new_RE(                 # per-recip multiple quarantines
618 #  [qr'^(.*)@example\.com$'i => 'spam-${1}@example.com'],
619 #  [qr/.*/                   => 'spam-quarantine'] );
620
621 # In addition to per-recip quarantine, a by-sender lookup is possible. It is
622 # similar to $spam_quarantine_to, but the lookup key is the sender address:
623 #$spam_quarantine_bysender_to = undef;   # dflt: no by-sender spam quarantine
624
625
626 # Add X-Virus-Scanned header field to mail?
627 $X_HEADER_TAG = 'X-Virus-Scanned';      # (default: undef)
628 # Leave empty to add no header          # (default: undef)
629 $X_HEADER_LINE = "by $myversion (Debian) at $mydomain";
630
631 # a string to prepend to Subject (for local recipients only) if mail could
632 # not be decoded or checked entirely, e.g. due to password-protected archives
633 $undecipherable_subject_tag = '***UNCHECKED*** ';  # undef disables it
634
635 $remove_existing_x_scanned_headers = 0; # leave existing X-Virus-Scanned alone
636 #$remove_existing_x_scanned_headers= 1; # remove existing headers
637                                         # (defaults to false)
638 #$remove_existing_spam_headers = 0;     # leave existing X-Spam* headers alone
639 $remove_existing_spam_headers  = 1;     # remove existing spam headers if
640                                         # spam scanning is enabled (default)
641
642 # set $bypass_decode_parts to true if you only do spam scanning, or if you
643 # have a good virus scanner that can deal with compression and recursively
644 # unpacking archives by itself, and save amavisd the trouble.
645 # Disabling decoding also causes banned_files checking to only see
646 # MIME names and MIME content types, not the content classification types
647 # as provided by the file(1) utility.
648 # It is a double-edged sword, make sure you know what you are doing!
649 #
650 #$bypass_decode_parts = 1;              # (defaults to false)
651
652 # don't trust this file type or corresponding unpacker for this file type,
653 # keep both the original and the unpacked file for a virus checker to see
654 # (lookup key is what file(1) utility returned):
655 #
656 $keep_decoded_original_re = new_RE(
657 # qr'^MAIL$',   # retain full original message for virus checking (can be slow)
658   qr'^MAIL-UNDECIPHERABLE$',  # retain full mail if it contains undecipherables
659   qr'^(ASCII(?! cpio)|text|uuencoded|xxencoded|binhex)'i,
660 # qr'^Zip archive data',
661 );
662
663 # Checking for banned MIME types and names. If any mail part matches,
664 # the whole mail is rejected, much like the way viruses are handled.
665 # A list in object $banned_filename_re can be defined to provide a list
666 # of Perl regular expressions to be matched against each part's:
667 #
668 #  * Content-Type value (both declared and effective mime-type),
669 #    including the possible security risk content types
670 #    message/partial and message/external-body, as specified by rfc2046;
671 #
672 #  * declared (i.e. recommended) file names as specified by MIME subfields
673 #    Content-Disposition.filename and Content-Type.name, both in their
674 #    raw (encoded) form and in rfc2047-decoded form if applicable;
675 #
676 #  * file content type as guessed by 'file' utility, both the raw
677 #    result from 'file', as well as short type name, classified
678 #    into names such as .asc, .txt, .html, .doc, .jpg, .pdf,
679 #    .zip, .exe, ... - see subroutine determine_file_types().
680 #    This step is done only if $bypass_decode_parts is not true.
681 #
682 #  * leave $banned_filename_re undefined to disable these checks
683 #    (giving an empty list to new_RE() will also always return false)
684
685 $banned_filename_re = new_RE(
686 #  qr'^UNDECIPHERABLE$',  # is or contains any undecipherable components
687    qr'\.[^.]*\.(exe|vbs|pif|scr|bat|cmd|com|dll)$'i, # some double extensions
688    qr'[{}]',     # curly braces in names (serve as Class ID extensions - CLSID)
689 #  qr'.\.(exe|vbs|pif|scr|bat|cmd|com)$'i,           # banned extension - basic
690 #  qr'.\.(ade|adp|bas|bat|chm|cmd|com|cpl|crt|exe|hlp|hta|inf|ins|isp|js|
691 #         jse|lnk|mdb|mde|msc|msi|msp|mst|pcd|pif|reg|scr|sct|shs|shb|vb|
692 #         vbe|vbs|wsc|wsf|wsh)$'ix,                  # banned extension - long
693 #  qr'.\.(mim|b64|bhx|hqx|xxe|uu|uue)$'i, # banned extension - WinZip vulnerab.
694 #  qr'^\.(zip|lha|tnef|cab)$'i,                      # banned file(1) types
695 #  qr'^\.exe$'i,                                     # banned file(1) types
696 #  qr'^application/x-msdownload$'i,                  # banned MIME types
697 #  qr'^application/x-msdos-program$'i,
698    qr'^message/partial$'i,  # rfc2046. this one is deadly for Outcrook
699 #  qr'^message/external-body$'i, # block rfc2046
700 );
701 # See http://support.microsoft.com/default.aspx?scid=kb;EN-US;q262631
702 # and http://www.cknow.com/vtutor/vtextensions.htm
703
704 # A little trick: a pattern qr'\.exe$' matches both a short type name '.exe',
705 # as well as any file name which happens to end with .exe. If only matching
706 # a file name is desired, but not the short name, a pattern qr'.\.exe$'i
707 # or similar may be used, which requires that at least one character precedes
708 # the '.exe', and so it will never match short file types, which always start
709 # with a dot.
710
711
712 #
713 # Section V - Per-recipient and per-sender handling, whitelisting, etc.
714 #
715
716 # %virus_lovers, @virus_lovers_acl and $virus_lovers_re lookup tables:
717 #   (these should be considered policy options, they do not disable checks,
718 #   see bypass*checks for that!)
719 #
720 # Exclude certain RECIPIENTS from virus filtering by adding their lower-cased
721 # envelope e-mail address (or domain only) to the hash %virus_lovers, or to
722 # the access list @virus_lovers_acl - see README.lookups and examples.
723 # Make sure the appropriate form (e.g. external/internal) of address
724 # is used in case of virtual domains, or when mapping external to internal
725 # addresses, etc. - this is MTA-specific.
726 #
727 # Notifications would still be generated however (see the overall
728 # picture above), and infected mail (if passed) gets additional header:
729 #   X-AMaViS-Alert: INFECTED, message contains virus: ...
730 # (header not inserted with milter interface!)
731 #
732 # NOTE (milter interface only): in case of multiple recipients,
733 # it is only possible to drop or accept the message in its entirety - for all
734 # recipients. If all of them are virus lovers, we'll accept mail, but if
735 # at least one recipient is not a virus lover, we'll discard the message.
736
737
738 # %bypass_virus_checks, @bypass_virus_checks_acl and $bypass_virus_checks_re
739 # lookup tables:
740 #   (this is mainly a time-saving option, unlike virus_lovers* !)
741 #
742 # Similar in concept to %virus_lovers, a hash %bypass_virus_checks,
743 # access list @bypass_virus_checks_acl and regexp list $bypass_virus_checks_re
744 # are used to skip entirely the decoding, unpacking and virus checking,
745 # but only if ALL recipients match the lookup.
746 #
747 # %bypass_virus_checks/@bypass_virus_checks_acl/$bypass_virus_checks_re
748 # do NOT GUARANTEE the message will NOT be checked for viruses - this may
749 # still happen when there is more than one recipient for a message, and
750 # not all of them match these lookup tables. To guarantee virus delivery,
751 # a recipient must also match %virus_lovers/@virus_lovers_acl lookups
752 # (but see milter limitations above),
753
754 # NOTE: it would not be clever to base virus checks on SENDER address,
755 # since there are no guarantees that it is genuine. Many viruses
756 # and spam messages fake sender address. To achieve selective filtering
757 # based on the source of the mail (e.g. IP address, MTA port number, ...),
758 # use mechanisms provided by MTA if available.
759
760
761 # Similar to lookup tables controlling virus checking, there exist
762 # spam scanning, banned names/types, and headers_checks control counterparts:
763 #   %spam_lovers, @spam_lovers_acl, $spam_lovers_re
764 #   %banned_files_lovers, @banned_files_lovers_acl, $banned_files_lovers_re
765 #   %bad_header_lovers, @bad_header_lovers_acl, $bad_header_lovers_re
766 # and:
767 #   %bypass_spam_checks/@bypass_spam_checks_acl/$bypass_spam_checks_re
768 #   %bypass_banned_checks/@bypass_banned_checks_acl/$bypass_banned_checks_re
769 #   %bypass_header_checks/@bypass_header_checks_acl/$bypass_header_checks_re
770 # See README.lookups for details about the syntax.
771
772 # The following example disables spam checking altogether,
773 # since it matches any recipient e-mail address (any address
774 # is a subdomain of the top-level root DNS domain):
775 #   @bypass_spam_checks_acl = qw( . );
776
777 #   @bypass_header_checks_acl = qw( user@example.com );
778 #   @bad_header_lovers_acl    = qw( user@example.com );
779
780
781 # See README.lookups for further detail, and examples below.
782
783 # $virus_lovers{lc("postmaster\@$mydomain")} = 1;
784 # $virus_lovers{lc('postmaster@example.com')} = 1;
785 # $virus_lovers{lc('abuse@example.com')} = 1;
786 # $virus_lovers{lc('some.user@')} = 1;  # this recipient, regardless of domain
787 # $virus_lovers{lc('boss@example.com')} = 0; # never, even if domain matches
788 # $virus_lovers{lc('example.com')} = 1; # this domain, but not its subdomains
789 # $virus_lovers{lc('.example.com')}= 1; # this domain, including its subdomains
790 #or:
791 # @virus_lovers_acl = qw( me@lab.xxx.com !lab.xxx.com .xxx.com yyy.org );
792 #
793 # $bypass_virus_checks{lc('some.user2@butnot.example.com')} = 1;
794 # @bypass_virus_checks_acl = qw( some.ddd !butnot.example.com .example.com );
795
796 # @virus_lovers_acl = qw( postmaster@example.com );
797 # $virus_lovers_re = new_RE( qr'^(helpdesk|postmaster)@example\.com$'i );
798
799 # $spam_lovers{lc("postmaster\@$mydomain")} = 1;
800 # $spam_lovers{lc('postmaster@example.com')} = 1;
801 # $spam_lovers{lc('abuse@example.com')} = 1;
802 # @spam_lovers_acl = qw( !.example.com );
803 # $spam_lovers_re = new_RE( qr'^user@example\.com$'i );
804
805
806 # don't run spam check for these RECIPIENT domains:
807 #   @bypass_spam_checks_acl = qw( d1.com .d2.com a.d3.com );
808 # or the other way around (bypass check for all BUT these):
809 #   @bypass_spam_checks_acl = qw( !d1.com !.d2.com !a.d3.com . );
810 # a practical application: don't check outgoing mail for spam:
811 #   @bypass_spam_checks_acl = ( "!.$mydomain", "." );
812 # (a downside of which is that such mail will not count as ham in SA bayes db)
813
814
815 # Where to find SQL server(s) and database to support SQL lookups?
816 # A list of triples: (dsn,user,passw).   (dsn = data source name)
817 # More than one entry may be specified for multiple (backup) SQL servers.
818 # See 'man DBI', 'man DBD::mysql', 'man DBD::Pg', ... for details.
819 # When chroot-ed, accessing SQL server over inet socket may be more convenient.
820 #
821 # @lookup_sql_dsn =
822 #   ( ['DBI:mysql:database=mail;host=127.0.0.1;port=3306', 'user1', 'passwd1'],
823 #     ['DBI:mysql:database=mail;host=host2', 'username2', 'password2'] );
824 #
825 # ('mail' in the example is the database name, choose what you like)
826 # With PostgreSQL the dsn (first element of the triple) may look like:
827 #      'DBI:Pg:host=host1;dbname=mail'
828
829 # The SQL select clause to fetch per-recipient policy settings.
830 # The %k will be replaced by a comma-separated list of query addresses
831 # (e.g. full address, domain only, catchall).  Use ORDER, if there
832 # is a chance that multiple records will match - the first match wins.
833 # If field names are not unique (e.g. 'id'), the later field overwrites the
834 # earlier in a hash returned by lookup, which is why we use '*,users.id'.
835 # $sql_select_policy = 'SELECT *,users.id FROM users,policy'.
836 #   ' WHERE (users.policy_id=policy.id) AND (users.email IN (%k))'.
837 #   ' ORDER BY users.priority DESC';
838 #
839 # The SQL select clause to check sender in per-recipient whitelist/blacklist
840 # The first SELECT argument '?' will be users.id from recipient SQL lookup,
841 # the %k will be sender addresses (e.g. full address, domain only, catchall).
842 # $sql_select_white_black_list = 'SELECT wb FROM wblist,mailaddr'.
843 #     ' WHERE (wblist.rid=?) AND (wblist.sid=mailaddr.id)'.
844 #     '   AND (mailaddr.email IN (%k))'.
845 #   ' ORDER BY mailaddr.priority DESC';
846
847 $sql_select_white_black_list = undef;  # undef disables SQL white/blacklisting
848
849
850 # If you decide to pass viruses (or spam) to certain recipients using the
851 # above lookup tables or using $final_virus_destiny=D_PASS, you can set
852 # the variable $addr_extension_virus ($addr_extension_spam) to some
853 # string, and the recipient address will have this string appended
854 # as an address extension to the local-part of the address. This extension
855 # can be used by final local delivery agent to place such mail in different
856 # folders. Leave these two variables undefined or empty strings to prevent
857 # appending address extensions. Setting has no effect on recipient which will
858 # not be receiving viruses/spam. Recipients who do not match lookup tables
859 # local_domains* are not affected.
860 #
861 # LDAs usually default to stripping away address extension if no special
862 # handling is specified, so having this option enabled normally does no harm,
863 # provided the $recipients_delimiter matches the setting on the final
864 # MTA's LDA.
865
866 # $addr_extension_virus  = 'virus';     # (default is undef, same as empty)
867 # $addr_extension_spam   = 'spam';      # (default is undef, same as empty)
868 # $addr_extension_banned = 'banned';    # (default is undef, same as empty)
869
870
871 # Delimiter between local part of the recipient address and address extension
872 # (which can optionally be added, see variables $addr_extension_virus and
873 # $addr_extension_spam). E.g. recipient address <user@example.com> gets changed
874 # to <user+virus@example.com>.
875 #
876 # Delimiter should match equivalent (final) MTA delimiter setting.
877 # (e.g. for Postfix add 'recipient_delimiter = +' to main.cf)
878 # Setting it to an empty string or to undef disables this feature
879 # regardless of $addr_extension_virus and $addr_extension_spam settings.
880
881 $recipient_delimiter = '+';             # (default is '+')
882
883 # true: replace extension;  false: append extension
884 $replace_existing_extension = 1;        # (default is false)
885
886 # Affects matching of localpart of e-mail addresses (left of '@')
887 # in lookups: true = case sensitive, false = case insensitive
888 $localpart_is_case_sensitive = 0;       # (default is false)
889
890
891 # ENVELOPE SENDER WHITELISTING / BLACKLISTING  - GLOBAL (RECIPIENT-INDEPENDENT)
892 # (affects spam checking only, has no effect on virus and other checks)
893
894 # WHITELISTING: use ENVELOPE SENDER lookups to ENSURE DELIVERY from whitelisted
895 # senders even if the message would be recognized as spam. Effectively, for
896 # the specified senders, message recipients temporarily become 'spam_lovers'.
897 # To avoid surprises, whitelisted sender also suppresses inserting/editing
898 # the tag2-level header fields (X-Spam-*, Subject), appending spam address
899 # extension, and quarantining.
900
901 # BLACKLISTING: messages from specified SENDERS are DECLARED SPAM.
902 # Effectively, for messages from blacklisted senders, spam level
903 # is artificially pushed high, and the normal spam processing applies,
904 # resulting in 'X-Spam-Flag: YES', high 'X-Spam-Level' bar and other usual
905 # reactions to spam, including possible rejection. If the message nevertheless
906 # still passes (e.g. for spam loving recipients), it is tagged as BLACKLISTED
907 # in the 'X-Spam-Status' header field, but the reported spam value and
908 # set of tests in this report header field (if available from SpamAssassin,
909 # which may have not been called) is not adjusted.
910 #
911 # A sender may be both white- and blacklisted at the same time, settings
912 # are independent. For example, being both white- and blacklisted, message
913 # is delivered to recipients, but is not tagged as spam (X-Spam-Flag: No;
914 # X-Spam-Status: No, ...), but the reported spam level (if computed) may
915 # still indicate high spam score.
916 #
917 # If ALL recipients of the message either white- or blacklist the sender,
918 # spam scanning (calling the SpamAssassin) is bypassed, saving on time.
919 #
920 # The following variables (lookup tables) are available, with the semantics
921 # and syntax as specified in README.lookups:
922 #
923 # %whitelist_sender, @whitelist_sender_acl, $whitelist_sender_re
924 # %blacklist_sender, @blacklist_sender_acl, $blacklist_sender_re
925
926 # SOME EXAMPLES:
927 #
928 #ACL:
929 # @whitelist_sender_acl = qw( .example.com );
930 #
931 # @whitelist_sender_acl = ( ".$mydomain" );  # $mydomain and its subdomains
932 # NOTE: This is not a reliable way of turning off spam checks for
933 #       locally-originating mail, as sender address can easily be faked.
934 #       To reliably avoid spam-scanning outgoing mail,
935 #       use @bypass_spam_checks_acl .
936
937 #RE:
938 # $whitelist_sender_re = new_RE(
939 #   qr'^postmaster@.*\bexample\.com$'i,
940 #   qr'owner-[^@]*@'i,  qr'-request@'i,
941 #   qr'\.example\.com$'i );
942 #
943 $blacklist_sender_re = new_RE(
944     qr'^(bulkmail|offers|cheapbenefits|earnmoney|foryou|greatcasino)@'i,
945     qr'^(investments|lose_weight_today|market\.alert|money2you|MyGreenCard)@'i,
946     qr'^(new\.tld\.registry|opt-out|opt-in|optin|saveonl|smoking2002k)@'i,
947     qr'^(specialoffer|specialoffers|stockalert|stopsnoring|wantsome)@'i,
948     qr'^(workathome|yesitsfree|your_friend|greatoffers)@'i,
949     qr'^(inkjetplanet|marketopt|MakeMoney)\d*@'i,
950 );
951
952 #HASH lookup variant:
953 # NOTE: Perl operator qw splits its argument string by whitespace
954 # and produces a list. This means that addresses can not contain
955 # whitespace, and there is no provision for comments within the string.
956 # You can use the normal Perl list syntax if you have special requirements,
957 # e.g. map {...} ('one user@bla', '.second.com'), or use read_hash to read
958 # addresses from a file.
959 #
960
961 # a hash lookup table can be read from a file,
962 # one address per line, comments and empty lines are permitted:
963 #
964 # read_hash(\%whitelist_sender, '/var/amavis/whitelist_sender');
965
966 # ... or set directly:
967 map { $whitelist_sender{lc($_)}=1 } (qw(
968   nobody@cert.org
969   owner-alert@iss.net
970   slashdot@slashdot.org
971   bugtraq@securityfocus.com
972   NTBUGTRAQ@LISTSERV.NTBUGTRAQ.COM
973   security-alerts@linuxsecurity.com
974   amavis-user-admin@lists.sourceforge.net
975   razor-users-admin@lists.sourceforge.net
976   notification-return@lists.sophos.com
977   mailman-announce-admin@python.org
978   zope-announce-admin@zope.org
979   owner-postfix-users@postfix.org
980   owner-postfix-announce@postfix.org
981   owner-sendmail-announce@lists.sendmail.org
982   sendmail-announce-request@lists.sendmail.org
983   ca+envelope@sendmail.org
984   owner-technews@postel.ACM.ORG
985   lvs-users-admin@LinuxVirtualServer.org
986   ietf-123-owner@loki.ietf.org
987   cvs-commits-list-admin@gnome.org
988   rt-users-admin@lists.fsck.com
989   owner-announce@mnogosearch.org
990   owner-hackers@ntp.org
991   owner-bugs@ntp.org
992   clp-request@comp.nus.edu.sg
993   surveys-errors@lists.nua.ie
994   emailNews@genomeweb.com
995   owner-textbreakingnews@CNNIMAIL12.CNN.COM
996   yahoo-dev-null@yahoo-inc.com
997 ));
998
999
1000 # ENVELOPE SENDER WHITELISTING / BLACKLISTING - PER-RECIPIENT
1001
1002 # The same semantics as for global white/blacklisting applies, but this
1003 # time each recipient (or its domain, or subdomain, ...) can be given
1004 # an individual lookup table for matching senders. The per-recipient lookups
1005 # override the global lookups, which serve as a fallback default.
1006
1007 # Specify a two-level lookup table: the key for the outer table is recipient,
1008 # and the result should be an inner lookup table (hash or ACL or RE),
1009 # where the key used will be the sender.
1010 #
1011 #$per_recip_blacklist_sender_lookup_tables = {
1012 # 'user1@my.example.com'=>new_RE(qr'^(inkjetplanet|marketopt|MakeMoney)\d*@'i),
1013 # 'user2@my.example.com'=>[qw( spammer@d1.example,org .d2.example,org )],
1014 #};
1015 #$per_recip_whitelist_sender_lookup_tables = {
1016 # 'user@my.example.com' => [qw( friend@example.org .other.example.org )],
1017 # '.my1.example.com'    => [qw( !foe.other.example,org .other.example,org )],
1018 # '.my2.example.com'    => read_hash('/var/amavis/my2-wl.dat'),
1019 # 'abuse@' => { 'postmaster@'=>1,
1020 #               'cert-advisory-owner@cert.org'=>1, 'owner-alert@iss.net'=>1 },
1021 #};
1022
1023
1024 #
1025 # Section VI - Resource limits
1026 #
1027
1028 # Sanity limit to the number of allowed recipients per SMTP transaction
1029 # $smtpd_recipient_limit = 1000;  # (default is 1000)
1030
1031
1032 # Resource limits to protect unpackers, decompressors and virus scanners
1033 # against mail bombs (e.g. 42.zip)
1034
1035 # Maximum recursion level for extraction/decoding (0 or undef disables limit)
1036 $MAXLEVELS = 14;                # (default is undef, no limit)
1037
1038 # Maximum number of extracted files (0 or undef disables the limit)
1039 $MAXFILES = 1500;               # (default is undef, no limit)
1040
1041 # For the cumulative total of all decoded mail parts we set max storage size
1042 # to defend against mail bombs. Even though parts may be deleted (replaced
1043 # by decoded text) during decoding, the size they occupied is _not_ returned
1044 # to the quota pool.
1045 #
1046 # Parameters to storage quota formula for unpacking/decoding/decompressing
1047 #   Formula:
1048 #     quota = max($MIN_EXPANSION_QUOTA,
1049 #                 $mail_size*$MIN_EXPANSION_FACTOR,
1050 #                 min($MAX_EXPANSION_QUOTA, $mail_size*$MAX_EXPANSION_FACTOR))
1051 #   In plain words (later condition overrules previous ones):
1052 #     allow MAX_EXPANSION_FACTOR times initial mail size,
1053 #     but not more than MAX_EXPANSION_QUOTA,
1054 #     but not less than MIN_EXPANSION_FACTOR times initial mail size,
1055 #     but never less than MIN_EXPANSION_QUOTA
1056 #
1057 $MIN_EXPANSION_QUOTA =      100*1024;  # bytes  (default undef, not enforced)
1058 $MAX_EXPANSION_QUOTA = 300*1024*1024;  # bytes  (default undef, not enforced)
1059 $MIN_EXPANSION_FACTOR =   5;  # times original mail size  (must be specified)
1060 $MAX_EXPANSION_FACTOR = 500;  # times original mail size  (must be specified)
1061
1062
1063 #
1064 # Section VII - External programs, virus scanners
1065 #
1066
1067 # Specify a path string, which is a colon-separated string of directories
1068 # (no trailing slashes!) to be assigned to the environment variable PATH
1069 # and to serve for locating external programs below.
1070
1071 # NOTE: if $daemon_chroot_dir is nonempty, the directories will be
1072 #       relative to the chroot directory specified;
1073
1074 $path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin';
1075
1076 # Specify one string or a search list of strings (first match wins).
1077 # The string (or: each string in a list) may be an absolute path,
1078 # or just a program name, to be located via $path;
1079 # Empty string or undef (=default) disables the use of that external program.
1080 # Optionally command arguments may be specified - only the first substring
1081 # up to the whitespace is used for file searching.
1082
1083 $file   = 'file';   # file(1) utility; use 3.41 or later to avoid vulnerability
1084
1085 $gzip   = 'gzip';
1086 $bzip2  = 'bzip2';
1087 $lzop   = 'lzop';
1088 $uncompress = ['uncompress', 'gzip -d', 'zcat'];
1089 $unfreeze   = ['unfreeze', 'freeze -d', 'melt', 'fcat'];
1090 $arc        = ['nomarch', 'arc'];
1091 $unarj      = ['arj', 'unarj'];  # both can extract, arj is recommended
1092 $unrar      = ['rar', 'unrar'];  # both can extract, same options
1093 $zoo    = 'zoo';
1094 $lha    = 'lha';
1095 $cpio   = 'cpio';   # comment out if cpio does not support GNU options
1096
1097
1098 # SpamAssassin settings
1099
1100 # $sa_local_tests_only is passed to Mail::SpamAssassin::new as a value
1101 # of the option local_tests_only. See Mail::SpamAssassin man page.
1102 # If set to 1, SA tests are restricted to local tests only, i.e. no tests
1103 # that require internet access will be performed.
1104 #
1105 $sa_local_tests_only = 1;   # (default: false)
1106 #$sa_auto_whitelist = 1;    # turn on AWL (default: false)
1107
1108 # Timout for SpamAssassin. This is only used if spamassassin does NOT
1109 # override it (which it often does if sa_local_tests_only is not true)
1110 $sa_timeout = 30;           # timeout in seconds for a call to SpamAssassin
1111                             # (default is 30 seconds, undef disables it)
1112
1113 # AWL (auto whitelisting), requires spamassassin 2.44 or better
1114 # $sa_auto_whitelist = 1;   # defaults to undef
1115
1116 $sa_mail_body_size_limit = 150*1024;  # don't waste time on SA is mail is larger
1117                             # (less than 1% of spam is > 64k)
1118                             # default: undef, no limitations
1119
1120 # default values, can be overridden by more specific lookups, e.g. SQL
1121 $sa_tag_level_deflt  = 4.0; # add spam info headers if at, or above that level
1122 $sa_tag2_level_deflt = 6.3; # add 'spam detected' headers at that level
1123 $sa_kill_level_deflt = $sa_tag2_level_deflt; # triggers spam evasive actions
1124                            # at or above that level: bounce/reject/drop,
1125                            # quarantine, and adding mail address extension
1126
1127 $sa_dsn_cutoff_level = 10;  # spam level beyond which a DSN is not sent,
1128                             # effectively turning D_BOUNCE into D_DISCARD;
1129                             # undef disables this feature and is a default;
1130
1131 #
1132 # The $sa_tag_level_deflt, $sa_tag2_level_deflt and $sa_kill_level_deflt
1133 # may also be hashrefs to hash lookup tables, to make static per-recipient
1134 # settings possible without having to resort to SQL or LDAP lookups.
1135
1136 # a quick reference:
1137 #   tag_level  controls adding the X-Spam-Status and X-Spam-Level headers,
1138 #   tag2_level controls adding 'X-Spam-Flag: YES', and editing Subject,
1139 #   kill_level controls 'evasive actions' (reject, quarantine, extensions);
1140 # it only makes sense to maintain the relationship:
1141 # tag_level <= tag2_level <= kill_level < $sa_dsn_cutoff_level
1142
1143 # string to prepend to Subject header field when message exceeds tag2 level
1144 $sa_spam_subject_tag = '***SPAM*** ';   # (defaults to undef, disabled)
1145                              # (only seen when spam is not to be rejected
1146                              # and recipient is in local_domains*)
1147
1148 #$sa_spam_modifies_subj = 1; # may be a ref to a lookup table, default is true
1149 # Example: modify Subject for all local recipients except user@example.com
1150 #$sa_spam_modifies_subj = [qw( !user@example.com . )];
1151
1152 # stop anti-virus scanning when the first scanner detects a virus?
1153 $first_infected_stops_scan = 1;  # default is false, all scanners are called
1154
1155 # @av_scanners is a list of n-tuples, where fields semantics is:
1156 #  1. av scanner plain name, to be used in log and reports;
1157 #  2. scanner program name; this string will be submitted to subroutine
1158 #     find_external_programs(), which will try to find the full program
1159 #     path name; if program is not found, this scanner is disabled.
1160 #     Besides a simple string (full program path name or just the basename
1161 #     to be looked for in PATH), this may be an array ref of alternative
1162 #     program names or full paths - the first match in the list will be used;
1163 #     As a special case for more complex scanners, this field may be
1164 #     a subroutine reference, and the whole n-tuple is passed to it as args.
1165 #  3. command arguments to be given to the scanner program;
1166 #     a substring {} will be replaced by the directory name to be scanned,
1167 #     i.e. "$tempdir/parts", a "*" will be replaced by file names of parts;
1168 #  4. an array ref of av scanner exit status values, or a regexp (to be
1169 #     matched against scanner output), indicating NO VIRUSES found;
1170 #  5. an array ref of av scanner exit status values, or a regexp (to be
1171 #     matched against scanner output), indicating VIRUSES WERE FOUND;
1172 #     Note: the virus match prevails over a 'not found' match, so it is safe
1173 #     even if the no. 4. matches for viruses too;
1174 #  6. a regexp (to be matched against scanner output), returning a list
1175 #     of virus names found.
1176 #  7. and 8.: (optional) subroutines to be executed before and after scanner
1177 #     (e.g. to set environment or current directory);
1178 #     see examples for these at KasperskyLab AVP and Sophos sweep.
1179
1180 # NOTES:
1181 #
1182 # - NOT DEFINING @av_scanners (e.g. setting it to empty list, or deleting the
1183 #   whole assignment) TURNS OFF LOADING AND COMPILING OF THE ANTIVIRUS CODE
1184 #   (which can be handy if all you want to do is spam scanning);
1185 #
1186 # - the order matters: although _all_ available entries from the list are
1187 #   always tried regardless of their verdict, scanners are run in the order
1188 #   specified: the report from the first one detecting a virus will be used
1189 #   (providing virus names and scanner output); REARRANGE THE ORDER TO WILL;
1190 #
1191 # - it doesn't hurt to keep an unused command line scanner entry in the list
1192 #   if the program can not be found; the path search is only performed once
1193 #   during the program startup;
1194 #
1195 #   COROLLARY: to disable a scanner that _does_ exist on your system,
1196 #   comment out its entry or use undef or '' as its program name/path
1197 #   (second parameter). An example where this is almost a must: disable
1198 #   Sophos 'sweep' if you have its daemonized version Sophie or SAVI-Perl
1199 #   (same for Trophie/vscan, and clamd/clamscan), or if another unrelated
1200 #   program happens to have a name matching one of the entries ('sweep'
1201 #   again comes to mind);
1202 #
1203 # - it DOES HURT to keep unwanted entries which use INTERNAL SUBROUTINES
1204 #   for interfacing (where the second parameter starts with \&).
1205 #   Keeping such entry and not having a corresponding virus scanner daemon
1206 #   causes an unnecessary connection attempt (which eventually times out,
1207 #   but it wastes precious time). For this reason the daemonized entries
1208 #   are commented in the distribution - just remove the '#' where needed.
1209 #
1210 # CERT list of av resources: http://www.cert.org/other_sources/viruses.html
1211
1212 @av_scanners = (
1213
1214 # ### http://www.vanja.com/tools/sophie/
1215 # ['Sophie',
1216 #   \&ask_daemon, ["{}/\n", '/var/run/sophie'],
1217 #   qr/(?x)^ 0+ ( : | [\000\r\n]* $)/,  qr/(?x)^ 1 ( : | [\000\r\n]* $)/,
1218 #   qr/(?x)^ [-+]? \d+ : (.*?) [\000\r\n]* $/ ],
1219
1220 # ### http://www.csupomona.edu/~henson/www/projects/SAVI-Perl/
1221 # ['Sophos SAVI', \&sophos_savi ],
1222
1223 ### http://www.clamav.net/
1224 ['Clam Antivirus-clamd',
1225   \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.ctl"],
1226   qr/\bOK$/, qr/\bFOUND$/,
1227   qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
1228 # NOTE: run clamd under the same user as amavisd;  match the socket
1229 # name (LocalSocket) in clamav.conf to the socket name in this entry
1230 # When running chrooted one may prefer: ["CONTSCAN {}\n","$MYHOME/clamd"],
1231
1232 # ### http://www.openantivirus.org/
1233 # ['OpenAntiVirus ScannerDaemon (OAV)',
1234 #   \&ask_daemon, ["SCAN {}\n", '127.0.0.1:8127'],
1235 #   qr/^OK/, qr/^FOUND: /, qr/^FOUND: (.+)/ ],
1236
1237 # ### http://www.vanja.com/tools/trophie/
1238 # ['Trophie',
1239 #   \&ask_daemon, ["{}/\n", '/var/run/trophie'],
1240 #   qr/(?x)^ 0+ ( : | [\000\r\n]* $)/,  qr/(?x)^ 1 ( : | [\000\r\n]* $)/,
1241 #   qr/(?x)^ [-+]? \d+ : (.*?) [\000\r\n]* $/ ],
1242
1243 # ### http://www.grisoft.com/
1244 # ['AVG Anti-Virus',
1245 #   \&ask_daemon, ["SCAN {}\n", '127.0.0.1:55555'],
1246 #   qr/^200/, qr/^403/, qr/^403 .*?: (.+)/ ],
1247
1248 # ### http://www.f-prot.com/
1249 # ['FRISK F-Prot Daemon',
1250 #   \&ask_daemon,
1251 #   ["GET {}/*?-dumb%20-archive%20-packed HTTP/1.0\r\n\r\n",
1252 #     ['127.0.0.1:10200','127.0.0.1:10201','127.0.0.1:10202',
1253 #      '127.0.0.1:10203','127.0.0.1:10204'] ],
1254 #   qr/(?i)<summary[^>]*>clean<\/summary>/,
1255 #   qr/(?i)<summary[^>]*>infected<\/summary>/,
1256 #   qr/(?i)<name>(.+)<\/name>/ ],
1257
1258   ['KasperskyLab AVP - aveclient',
1259     ['/usr/local/kav/bin/aveclient','/usr/local/share/kav/bin/aveclient',
1260      '/opt/kav/bin/aveclient','aveclient'],
1261     '-p /var/run/aveserver -s {}/*', [0,3,6,8], qr/\b(INFECTED|SUSPICION)\b/,
1262     qr/(?:INFECTED|SUSPICION) (.+)/,
1263   ],
1264
1265   ['KasperskyLab AntiViral Toolkit Pro (AVP)', ['avp'],
1266     '-* -P -B -Y -O- {}', [0,8,16,24], [2,3,4,5,6, 18,19,20,21,22],
1267     qr/infected: (.+)/,
1268     sub {chdir('/opt/AVP') or die "Can't chdir to AVP: $!"},
1269     sub {chdir($TEMPBASE) or die "Can't chdir back to $TEMPBASE $!"},
1270   ],
1271
1272   ### The kavdaemon and AVPDaemonClient have been removed from Kasperky
1273   ### products and replaced by aveserver and aveclient
1274   ['KasperskyLab AVPDaemonClient',
1275     [ '/opt/AVP/kavdaemon',       'kavdaemon',
1276       '/opt/AVP/AvpDaemonClient', 'AvpDaemonClient',
1277       '/opt/AVP/AvpTeamDream',    'AvpTeamDream',
1278       '/opt/AVP/avpdc', 'avpdc' ],
1279     "-f=$TEMPBASE {}", [0,8,16,24], [2,3,4,5,6, 18,19,20,21,22],
1280     qr/infected: ([^\r\n]+)/ ],
1281     # change the startup-script in /etc/init.d/kavd to:
1282     #   DPARMS="-* -Y -dl -f=/var/amavis /var/amavis"
1283     #   (or perhaps:   DPARMS="-I0 -Y -* /var/amavis" )
1284     # adjusting /var/amavis above to match your $TEMPBASE.
1285     # The '-f=/var/amavis' is needed if not running it as root, so it
1286     # can find, read, and write its pid file, etc., see 'man kavdaemon'.
1287     # defUnix.prf: there must be an entry "*/var/amavis" (or whatever
1288     #   directory $TEMPBASE specifies) in the 'Names=' section.
1289     # cd /opt/AVP/DaemonClients; configure; cd Sample; make
1290     # cp AvpDaemonClient /opt/AVP/
1291     # su - vscan -c "${PREFIX}/kavdaemon ${DPARMS}"
1292
1293   ### http://www.hbedv.com/ or http://www.centralcommand.com/
1294   ['H+BEDV AntiVir or CentralCommand Vexira Antivirus',
1295     ['antivir','vexira'],
1296     '--allfiles -noboot -nombr -rs -s -z {}', [0], qr/ALERT:|VIRUS:/,
1297     qr/(?x)^\s* (?: ALERT: \s* (?: \[ | [^']* ' ) |
1298          (?i) VIRUS:\ .*?\ virus\ '?) ( [^\]\s']+ )/ ],
1299     # NOTE: if you only have a demo version, remove -z and add 214, as in:
1300     #  '--allfiles -noboot -nombr -rs -s {}', [0,214], qr/ALERT:|VIRUS:/,
1301
1302   ### http://www.commandsoftware.com/
1303   ['Command AntiVirus for Linux', 'csav',
1304     '-all -archive -packed {}', [50], [51,52,53],
1305     qr/Infection: (.+)/ ],
1306
1307   ### http://www.symantec.com/
1308   ['Symantec CarrierScan via Symantec CommandLineScanner',
1309     'cscmdline', '-a scan -i 1 -v -s 127.0.0.1:7777 {}',
1310     qr/^Files Infected:\s+0$/, qr/^Infected\b/,
1311     qr/^(?:Info|Virus Name):\s+(.+)/ ],
1312
1313   ### http://www.symantec.com/
1314   ['Symantec AntiVirus Scan Engine',
1315     'savsecls', '-server 127.0.0.1:7777 -mode scanrepair -details -verbose {}',
1316     [0], qr/^Infected\b/,
1317     qr/^(?:Info|Virus Name):\s+(.+)/ ],
1318     # NOTE: check options and patterns to see which entry better applies
1319
1320   ### http://www.sald.com/, http://drweb.imshop.de/
1321   ['drweb - DrWeb Antivirus',
1322     ['/usr/local/drweb/drweb', '/opt/drweb/drweb', 'drweb'],
1323     '-path={} -al -go -ot -cn -upn -ok-',
1324     [0,32], [1,33], qr' infected (?:with|by)(?: virus)? (.*)$'],
1325
1326 # ### http://www.sald.com/, http://www.dials.ru/english/, http://www.drweb.ru/
1327 # ['DrWebD', \&ask_daemon,   # DrWebD 4.31 or later
1328 #   [pack('N',1).  # DRWEBD_SCAN_CMD
1329 #    pack('N',0x00280001).   # DONT_CHANGEMAIL, IS_MAIL, RETURN_VIRUSES
1330 #    pack('N',     # path length
1331 #      length("$TEMPBASE/amavis-yyyymmddTHHMMSS-xxxxx/parts/part-xxxxx")).
1332 #    '{}/*'.       # path
1333 #    pack('N',0).  # content size
1334 #    pack('N',0),
1335 #    '/var/drweb/run/drwebd.sock',
1336 #  # '/var/amavis/var/run/drwebd.sock',   # suitable for chroot
1337 #  # '/usr/local/drweb/run/drwebd.sock',  # FreeBSD drweb ports default
1338 #  # '127.0.0.1:3000',                    # or over an inet socket
1339 #   ],
1340 #   qr/\A\x00(\x10|\x11)\x00\x00/s,              # IS_CLEAN, EVAL_KEY
1341 #   qr/\A\x00(\x00|\x01)\x00(\x20|\x40|\x80)/s,  # KNOWN_V, UNKNOWN_V, V._MODIF
1342 #   qr/\A.{12}(?:infected with )?([^\x00]+)\x00/s,
1343 # ],
1344 # # NOTE: If you are using amavis-milter, change length to:
1345 # # length("$TEMPBASE/amavis-milter-xxxxxxxxxxxxxx/parts/part-xxxxx").
1346
1347   ### http://www.f-secure.com/products/anti-virus/
1348   ['F-Secure Antivirus', 'fsav',
1349    '--dumb --mime --archive {}', [0], [3,8],
1350    qr/(?:infection|Infected|Suspected): (.+)/ ],
1351
1352   ['CAI InoculateIT', 'inocucmd',
1353     '-sec -nex {}', [0], [100],
1354     qr/was infected by virus (.+)/ ],
1355
1356   ['MkS_Vir for Linux (beta)', ['mks32','mks'],
1357     '-s {}/*', [0], [1,2],    # any use for options: -a -c  ?
1358     qr/--[ \t]*(.+)/ ], 
1359
1360   ### http://www.nod32.com/
1361   ['ESET Software NOD32', 'nod32',
1362     '-all -subdir+ {}', [0], [1,2],
1363     qr/^.+? - (.+?)\s*(?:backdoor|joke|trojan|virus|worm)/ ],
1364
1365   ### http://www.nod32.com/
1366   ['ESET Software NOD32 - Client/Server Version', 'nod32cli',
1367     '-a -r -d recurse --heur standard {}', [0], [10,11],
1368     qr/^\S+\s+infected:\s+(.+)/ ],
1369
1370   ### http://www.norman.com/products_nvc.shtml
1371   ['Norman Virus Control v5 / Linux', 'nvcc',
1372     '-c -l:0 -s -u {}', [0], [1],
1373     qr/(?i).* virus in .* -> \'(.+)\'/ ],
1374
1375   ### http://www.pandasoftware.com/
1376   ['Panda Antivirus for Linux', ['pavcl'],
1377     '-aut -aex -heu -cmp -nbr -nor -nso -eng {}',
1378     qr/Number of files infected[ .]*: 0(?!\d)/,
1379     qr/Number of files infected[ .]*: 0*[1-9]/,
1380     qr/Found virus :\s*(\S+)/ ],
1381
1382 # GeCAD AV technology is acquired by Microsoft; RAV has been discontinued.
1383 # Check your RAV license terms before fiddling with the following two lines!
1384 # ['GeCAD RAV AntiVirus 8', 'ravav',
1385 #   '--all --archive --mail {}', [1], [2,3,4,5], qr/Infected: (.+)/ ],
1386 # # NOTE: the command line switches changed with scan engine 8.5 !
1387 # # (btw, assigning stdin to /dev/null causes RAV to fail)
1388
1389   ### http://www.nai.com/
1390   ['NAI McAfee AntiVirus (uvscan)', 'uvscan',
1391     '--secure -rv --mime --summary --noboot - {}', [0], [13],
1392     qr/(?x) Found (?:
1393         \ the\ (.+)\ (?:virus|trojan)  |
1394         \ (?:virus|trojan)\ or\ variant\ ([^ ]+)  |
1395         :\ (.+)\ NOT\ a\ virus)/,
1396   # sub {$ENV{LD_PRELOAD}='/lib/libc.so.6'},
1397   # sub {delete $ENV{LD_PRELOAD}},
1398   ],
1399   # NOTE1: with RH9: force the dynamic linker to look at /lib/libc.so.6 before
1400   # anything else by setting environment variable LD_PRELOAD=/lib/libc.so.6
1401   # and then clear it when finished to avoid confusing anything else.
1402   # NOTE2: to treat encrypted files as viruses replace the [13] with:
1403   #  qr/^\s{5,}(Found|is password-protected|.*(virus|trojan))/
1404
1405   ### http://www.virusbuster.hu/en/
1406   ['VirusBuster', ['vbuster', 'vbengcl'],
1407     # VirusBuster Ltd. does not support the daemon version for the workstation 
1408     # engine (vbuster-eng-1.12-linux-i386-libc6.tgz) any longer. The names of
1409     # binaries, some parameters AND return codes (from 3 to 1) changed.
1410     "{} -ss -i '*' -log=$MYHOME/vbuster.log", [0], [1],
1411     qr/: '(.*)' - Virus/ ],
1412
1413 # ### http://www.virusbuster.hu/en/
1414 # ['VirusBuster (Client + Daemon)', 'vbengd',
1415 #   # HINT: for an infected file it returns always 3,
1416 #   # although the man-page tells a different story
1417 #   '-f -log scandir {}', [0], [3],
1418 #   qr/Virus found = (.*);/ ],
1419
1420   ### http://www.cyber.com/
1421   ['CyberSoft VFind', 'vfind',
1422     '--vexit {}/*', [0], [23], qr/##==>>>> VIRUS ID: CVDL (.+)/,
1423   # sub {$ENV{VSTK_HOME}='/usr/lib/vstk'},
1424   ],
1425
1426   ### http://www.ikarus-software.com/
1427   ['Ikarus AntiVirus for Linux', 'ikarus',
1428     '{}', [0], [40], qr/Signature (.+) found/ ],
1429
1430   ### http://www.bitdefender.com/
1431   ['BitDefender', 'bdc',
1432     '--all --arc --mail {}', qr/^Infected files *:0(?!\d)/,
1433     qr/^(?:Infected files|Identified viruses|Suspect files) *:0*[1-9]/,
1434     qr/(?:suspected|infected): (.*)(?:\033|$)/ ],
1435 );
1436
1437 # If no virus scanners from the @av_scanners list produce 'clean' nor
1438 # 'infected' status (e.g. they all fail to run or the list is empty),
1439 # then _all_ scanners from the @av_scanners_backup list are tried.
1440 # When there are both daemonized and command-line scanners available,
1441 # it is customary to place slower command-line scanners in the
1442 # @av_scanners_backup list. The default choice is somewhat arbitrary,
1443 # move entries from one list to another as desired.
1444
1445 @av_scanners_backup = (
1446
1447   ### http://www.clamav.net/
1448   ['Clam Antivirus - clamscan', 'clamscan',
1449     "--stdout --no-summary -r --tempdir=$TEMPBASE {}", [0], [1],
1450     qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
1451
1452   ### http://www.f-prot.com/
1453   ['FRISK F-Prot Antivirus', ['f-prot','f-prot.sh'],
1454     '-dumb -archive -packed {}', [0,8], [3,6],
1455     qr/Infection: (.+)/ ],
1456
1457   ### http://www.trendmicro.com/
1458   ['Trend Micro FileScanner', ['/etc/iscan/vscan','vscan'],
1459     '-za -a {}', [0], qr/Found virus/, qr/Found virus (.+) in/ ],
1460
1461   ['KasperskyLab kavscanner', ['/opt/kav/bin/kavscanner','kavscanner'],
1462     '-i1 -xp {}', [0,10,15], [5,20,21,25],
1463     qr/(?:CURED|INFECTED|CUREFAILED|WARNING|SUSPICION) (.*)/ ,
1464     sub {chdir('/opt/kav/bin') or die "Can't chdir to kav: $!"},
1465     sub {chdir($TEMPBASE) or die "Can't chdir back to $TEMPBASE $!"},
1466   ],
1467
1468 # Commented out because the name 'sweep' clashes with the Debian package of
1469 # the same name. Make sure the correct sweep is found in the path when enabling
1470 #
1471 # ### http://www.sophos.com/
1472 # ['Sophos Anti Virus (sweep)', 'sweep',
1473 #   '-nb -f -all -rec -ss -sc -archive -cab -tnef --no-reset-atime {}',
1474 #   [0,2], qr/Virus .*? found/,
1475 #   qr/^>>> Virus(?: fragment)? '?(.*?)'? found/,
1476 # ],
1477 # # other options to consider: -mime -oe -idedir=/usr/local/sav
1478
1479 # always succeeds (uncomment to consider mail clean if all other scanners fail)
1480 # ['always-clean', sub {0}],
1481
1482 );
1483
1484
1485 #
1486 # Section VIII - Debugging
1487 #
1488
1489 # The most useful debugging tool is to run amavisd-new non-detached
1490 # from a terminal window:
1491 # amavisd debug
1492
1493 # Some more refined approaches:
1494
1495 # If sender matches ACL, turn log level fully up, just for this one message,
1496 # and preserve temporary directory
1497 #@debug_sender_acl = ( "test-sender\@$mydomain" );
1498 #@debug_sender_acl = qw( debug@example.com );
1499
1500 # May be useful along with @debug_sender_acl:
1501 # Prevent all decoded originals being deleted (replaced by decoded part)
1502 #$keep_decoded_original_re = new_RE( qr/.*/ );
1503
1504 # Turn on SpamAssassin debugging (output to STDERR, use with 'amavisd debug')
1505 #$sa_debug = 1;            # defaults to false
1506
1507 #-------------
1508 1;  # insure a defined return