]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - config/amavisd/amavisd.conf
Wrote a fetchmail init script.
[people/pmueller/ipfire-2.x.git] / config / amavisd / amavisd.conf
1 use strict;
2
3 # a minimalistic configuration file for amavisd-new with all necessary settings
4 #
5 # see amavisd.conf-default for a list of all variables with their defaults;
6 # see amavisd.conf-sample for a traditional-style commented file;
7 # for more details see documentation in INSTALL, README_FILES/*
8 # and at http://www.ijs.si/software/amavisd/amavisd-new-docs.html
9
10
11 # COMMONLY ADJUSTED SETTINGS:
12
13 # @bypass_virus_checks_maps = (1); # controls running of anti-virus code
14 # @bypass_spam_checks_maps = (1); # controls running of anti-spam code
15 # $bypass_decode_parts = 1; # controls running of decoders&dearchivers
16
17 $max_servers = 2; # num of pre-forked children (2..15 is common), -m
18 $daemon_user = 'amavis'; # (no default; customary: vscan or amavis), -u
19 $daemon_group = 'amavis'; # (no default; customary: vscan or amavis), -g
20
21 $mydomain = 'example.com'; # a convenient default for other settings
22
23 # $MYHOME = '/var/amavis'; # a convenient default for other settings, -H
24 $TEMPBASE = "$MYHOME/tmp"; # working directory, needs to exist, -T
25 $ENV{TMPDIR} = $TEMPBASE; # environment variable TMPDIR, used by SA, etc.
26 $QUARANTINEDIR = '/var/virusmails'; # -Q
27 # $quarantine_subdir_levels = 1; # add level of subdirs to disperse quarantine
28
29 # $daemon_chroot_dir = $MYHOME; # chroot directory or undef, -R
30
31 # $db_home = "$MYHOME/db"; # dir for bdb nanny/cache/snmp databases, -D
32 # $helpers_home = "$MYHOME/var"; # working directory for SpamAssassin, -S
33 # $lock_file = "$MYHOME/var/amavisd.lock"; # -L
34 # $pid_file = "$MYHOME/var/amavisd.pid"; # -P
35 #NOTE: create directories $MYHOME/tmp, $MYHOME/var, $MYHOME/db manually
36
37 $log_level = 0; # verbosity 0..5, -d
38 $log_recip_templ = undef; # disable by-recipient level-0 log entries
39 $DO_SYSLOG = 1; # log via syslogd (preferred)
40 $syslog_facility = 'mail'; # Syslog facility as a string
41 # e.g.: mail, daemon, user, local0, ... local7
42 $syslog_priority = 'debug'; # Syslog base (minimal) priority as a string,
43 # choose from: emerg, alert, crit, err, warning, notice, info, debug
44
45 $enable_db = 1; # enable use of BerkeleyDB/libdb (SNMP and nanny)
46 $enable_global_cache = 1; # enable use of libdb-based cache if $enable_db=1
47 $nanny_details_level = 2; # nanny verbosity: 1: traditional, 2: detailed
48
49 @local_domains_maps = ( [".$mydomain"] ); # list of all local domains
50
51 @mynetworks = qw( 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10
52 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 );
53
54 $unix_socketname = "$MYHOME/amavisd.sock"; # amavisd-release or amavis-milter
55 # option(s) -p overrides $inet_socket_port and $unix_socketname
56
57 $inet_socket_port = 10024; # listen on this local TCP port(s)
58 # $inet_socket_port = [10024,10026]; # listen on multiple TCP ports
59
60 $policy_bank{'MYNETS'} = { # mail originating from @mynetworks
61 originating => 1, # is true in MYNETS by default, but let's make it explicit
62 os_fingerprint_method => undef, # don't query p0f for internal clients
63 };
64
65 # it is up to MTA to re-route mail from authenticated roaming users or
66 # from internal hosts to a dedicated TCP port (such as 10026) for filtering
67 $interface_policy{'10026'} = 'ORIGINATING';
68
69 $policy_bank{'ORIGINATING'} = { # mail supposedly originating from our users
70 originating => 1, # declare that mail was submitted by our smtp client
71 allow_disclaimers => 1, # enables disclaimer insertion if available
72 # notify administrator of locally originating malware
73 virus_admin_maps => ["virusalert\@$mydomain"],
74 spam_admin_maps => ["virusalert\@$mydomain"],
75 warnbadhsender => 1,
76 # forward to a smtpd service providing DKIM signing service
77 forward_method => 'smtp:[127.0.0.1]:10027',
78 # force MTA conversion to 7-bit (e.g. before DKIM signing)
79 smtpd_discard_ehlo_keywords => ['8BITMIME'],
80 bypass_banned_checks_maps => [1], # allow sending any file names and types
81 terminate_dsn_on_notify_success => 0, # don't remove NOTIFY=SUCCESS option
82 };
83
84 $interface_policy{'SOCK'} = 'AM.PDP-SOCK'; # only applies with $unix_socketname
85
86 # Use with amavis-release over a socket or with Petr Rehor's amavis-milter.c
87 # (with amavis-milter.c from this package or old amavis.c client use 'AM.CL'):
88 $policy_bank{'AM.PDP-SOCK'} = {
89 protocol => 'AM.PDP',
90 auth_required_release => 0, # do not require secret_id for amavisd-release
91 };
92
93 $sa_tag_level_deflt = 2.0; # add spam info headers if at, or above that level
94 $sa_tag2_level_deflt = 6.2; # add 'spam detected' headers at that level
95 $sa_kill_level_deflt = 6.9; # triggers spam evasive actions (e.g. blocks mail)
96 $sa_dsn_cutoff_level = 10; # spam level beyond which a DSN is not sent
97 # $sa_quarantine_cutoff_level = 25; # spam level beyond which quarantine is off
98 $penpals_bonus_score = 8; # (no effect without a @storage_sql_dsn database)
99 $penpals_threshold_high = $sa_kill_level_deflt; # don't waste time on hi spam
100
101 $sa_mail_body_size_limit = 400*1024; # don't waste time on SA if mail is larger
102 $sa_local_tests_only = 0; # only tests which do not require internet access?
103
104 # @lookup_sql_dsn =
105 # ( ['DBI:mysql:database=mail;host=127.0.0.1;port=3306', 'user1', 'passwd1'],
106 # ['DBI:mysql:database=mail;host=host2', 'username2', 'password2'],
107 # ["DBI:SQLite:dbname=$MYHOME/sql/mail_prefs.sqlite", '', ''] );
108 # @storage_sql_dsn = @lookup_sql_dsn; # none, same, or separate database
109
110 # $timestamp_fmt_mysql = 1; # if using MySQL *and* msgs.time_iso is TIMESTAMP;
111 # defaults to 0, which is good for non-MySQL or if msgs.time_iso is CHAR(16)
112
113 $virus_admin = "virusalert\@$mydomain"; # notifications recip.
114
115 $mailfrom_notify_admin = "virusalert\@$mydomain"; # notifications sender
116 $mailfrom_notify_recip = "virusalert\@$mydomain"; # notifications sender
117 $mailfrom_notify_spamadmin = "spam.police\@$mydomain"; # notifications sender
118 $mailfrom_to_quarantine = ''; # null return path; uses original sender if undef
119
120 @addr_extension_virus_maps = ('virus');
121 @addr_extension_banned_maps = ('banned');
122 @addr_extension_spam_maps = ('spam');
123 @addr_extension_bad_header_maps = ('badh');
124 # $recipient_delimiter = '+'; # undef disables address extensions altogether
125 # when enabling addr extensions do also Postfix/main.cf: recipient_delimiter=+
126
127 $path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin';
128 # $dspam = 'dspam';
129
130 $MAXLEVELS = 14;
131 $MAXFILES = 1500;
132 $MIN_EXPANSION_QUOTA = 100*1024; # bytes (default undef, not enforced)
133 $MAX_EXPANSION_QUOTA = 300*1024*1024; # bytes (default undef, not enforced)
134
135 $sa_spam_subject_tag = '***SPAM*** ';
136 $defang_virus = 1; # MIME-wrap passed infected mail
137 $defang_banned = 1; # MIME-wrap passed mail containing banned name
138 # for defanging bad headers only turn on certain minor contents categories:
139 $defang_by_ccat{+CC_BADH.",3"} = 1; # NUL or CR character in header
140 $defang_by_ccat{+CC_BADH.",5"} = 1; # header line longer than 998 characters
141 $defang_by_ccat{+CC_BADH.",6"} = 1; # header field syntax error
142
143
144 # OTHER MORE COMMON SETTINGS (defaults may suffice):
145
146 $myhostname = 'ipfire.localdomain'; # must be a fully-qualified domain name!
147
148 # $notify_method = 'smtp:[127.0.0.1]:10025';
149 # $forward_method = 'smtp:[127.0.0.1]:10025'; # set to undef with milter!
150
151 # $final_virus_destiny = D_DISCARD;
152 # $final_banned_destiny = D_BOUNCE;
153 # $final_spam_destiny = D_BOUNCE;
154 # $final_bad_header_destiny = D_PASS;
155
156 # $os_fingerprint_method = 'p0f:127.0.0.1:2345'; # to query p0f-analyzer.pl
157
158 ## hierarchy by which a final setting is chosen:
159 ## policy bank (based on port or IP address) -> *_by_ccat
160 ## *_by_ccat (based on mail contents) -> *_maps
161 ## *_maps (based on recipient address) -> final configuration value
162
163
164 # SOME OTHER VARIABLES WORTH CONSIDERING (see amavisd.conf-default for all)
165
166 # $warnbadhsender,
167 # $warnvirusrecip, $warnbannedrecip, $warnbadhrecip, (or @warn*recip_maps)
168 #
169 # @bypass_virus_checks_maps, @bypass_spam_checks_maps,
170 # @bypass_banned_checks_maps, @bypass_header_checks_maps,
171 #
172 # @virus_lovers_maps, @spam_lovers_maps,
173 # @banned_files_lovers_maps, @bad_header_lovers_maps,
174 #
175 # @blacklist_sender_maps, @score_sender_maps,
176 #
177 # $clean_quarantine_method, $virus_quarantine_to, $banned_quarantine_to,
178 # $bad_header_quarantine_to, $spam_quarantine_to,
179 #
180 # $defang_bad_header, $defang_undecipherable, $defang_spam
181
182
183 # REMAINING IMPORTANT VARIABLES ARE LISTED HERE BECAUSE OF LONGER ASSIGNMENTS
184
185 @keep_decoded_original_maps = (new_RE(
186 # qr'^MAIL$', # retain full original message for virus checking (can be slow)
187 qr'^MAIL-UNDECIPHERABLE$', # recheck full mail if it contains undecipherables
188 qr'^(ASCII(?! cpio)|text|uuencoded|xxencoded|binhex)'i,
189 # qr'^Zip archive data', # don't trust Archive::Zip
190 ));
191
192
193 # for $banned_namepath_re (a new-style of banned table) see amavisd.conf-sample
194
195 $banned_filename_re = new_RE(
196
197 ### BLOCKED ANYWHERE
198 # qr'^UNDECIPHERABLE$', # is or contains any undecipherable components
199 qr'^\.(exe-ms|dll)$', # banned file(1) types, rudimentary
200 # qr'^\.(exe|lha|tnef|cab|dll)$', # banned file(1) types
201
202 ### BLOCK THE FOLLOWING, EXCEPT WITHIN UNIX ARCHIVES:
203 # [ qr'^\.(gz|bz2)$' => 0 ], # allow any in gzip or bzip2
204 [ qr'^\.(rpm|cpio|tar)$' => 0 ], # allow any in Unix-type archives
205
206 qr'.\.(pif|scr)$'i, # banned extensions - rudimentary
207 # qr'^\.zip$', # block zip type
208
209 ### BLOCK THE FOLLOWING, EXCEPT WITHIN ARCHIVES:
210 # [ qr'^\.(zip|rar|arc|arj|zoo)$'=> 0 ], # allow any within these archives
211
212 qr'^application/x-msdownload$'i, # block these MIME types
213 qr'^application/x-msdos-program$'i,
214 qr'^application/hta$'i,
215
216 # qr'^message/partial$'i, # rfc2046 MIME type
217 # qr'^message/external-body$'i, # rfc2046 MIME type
218
219 # qr'^(application/x-msmetafile|image/x-wmf)$'i, # Windows Metafile MIME type
220 # qr'^\.wmf$', # Windows Metafile file(1) type
221
222 # block certain double extensions in filenames
223 qr'\.[^./]*[A-Za-z][^./]*\.\s*(exe|vbs|pif|scr|bat|cmd|com|cpl|dll)[.\s]*$'i,
224
225 # qr'\{[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}\}?'i, # Class ID CLSID, strict
226 # qr'\{[0-9a-z]{4,}(-[0-9a-z]{4,}){0,7}\}?'i, # Class ID extension CLSID, loose
227
228 qr'.\.(exe|vbs|pif|scr|cpl)$'i, # banned extension - basic
229 # qr'.\.(exe|vbs|pif|scr|cpl|bat|cmd|com)$'i, # banned extension - basic+cmd
230 # qr'.\.(ade|adp|app|bas|bat|chm|cmd|com|cpl|crt|emf|exe|fxp|grp|hlp|hta|
231 # inf|ins|isp|js|jse|lnk|mda|mdb|mde|mdw|mdt|mdz|msc|msi|msp|mst|
232 # ops|pcd|pif|prg|reg|scr|sct|shb|shs|vb|vbe|vbs|
233 # wmf|wsc|wsf|wsh)$'ix, # banned ext - long
234 # qr'.\.(ani|cur|ico)$'i, # banned cursors and icons filename
235 # qr'^\.ani$', # banned animated cursor file(1) type
236
237 # qr'.\.(mim|b64|bhx|hqx|xxe|uu|uue)$'i, # banned extension - WinZip vulnerab.
238 );
239 # See http://support.microsoft.com/default.aspx?scid=kb;EN-US;q262631
240 # and http://www.cknow.com/vtutor/vtextensions.htm
241
242
243 # ENVELOPE SENDER SOFT-WHITELISTING / SOFT-BLACKLISTING
244
245 @score_sender_maps = ({ # a by-recipient hash lookup table,
246 # results from all matching recipient tables are summed
247
248 # ## per-recipient personal tables (NOTE: positive: black, negative: white)
249 # 'user1@example.com' => [{'bla-mobile.press@example.com' => 10.0}],
250 # 'user3@example.com' => [{'.ebay.com' => -3.0}],
251 # 'user4@example.com' => [{'cleargreen@cleargreen.com' => -7.0,
252 # '.cleargreen.com' => -5.0}],
253
254 ## site-wide opinions about senders (the '.' matches any recipient)
255 '.' => [ # the _first_ matching sender determines the score boost
256
257 new_RE( # regexp-type lookup table, just happens to be all soft-blacklist
258 [qr'^(bulkmail|offers|cheapbenefits|earnmoney|foryou)@'i => 5.0],
259 [qr'^(greatcasino|investments|lose_weight_today|market\.alert)@'i=> 5.0],
260 [qr'^(money2you|MyGreenCard|new\.tld\.registry|opt-out|opt-in)@'i=> 5.0],
261 [qr'^(optin|saveonlsmoking2002k|specialoffer|specialoffers)@'i => 5.0],
262 [qr'^(stockalert|stopsnoring|wantsome|workathome|yesitsfree)@'i => 5.0],
263 [qr'^(your_friend|greatoffers)@'i => 5.0],
264 [qr'^(inkjetplanet|marketopt|MakeMoney)\d*@'i => 5.0],
265 ),
266
267 # read_hash("/var/amavis/sender_scores_sitewide"),
268
269 { # a hash-type lookup table (associative array)
270 'nobody@cert.org' => -3.0,
271 'cert-advisory@us-cert.gov' => -3.0,
272 'owner-alert@iss.net' => -3.0,
273 'slashdot@slashdot.org' => -3.0,
274 'securityfocus.com' => -3.0,
275 'ntbugtraq@listserv.ntbugtraq.com' => -3.0,
276 'security-alerts@linuxsecurity.com' => -3.0,
277 'mailman-announce-admin@python.org' => -3.0,
278 'amavis-user-admin@lists.sourceforge.net'=> -3.0,
279 'amavis-user-bounces@lists.sourceforge.net' => -3.0,
280 'spamassassin.apache.org' => -3.0,
281 'notification-return@lists.sophos.com' => -3.0,
282 'owner-postfix-users@postfix.org' => -3.0,
283 'owner-postfix-announce@postfix.org' => -3.0,
284 'owner-sendmail-announce@lists.sendmail.org' => -3.0,
285 'sendmail-announce-request@lists.sendmail.org' => -3.0,
286 'donotreply@sendmail.org' => -3.0,
287 'ca+envelope@sendmail.org' => -3.0,
288 'noreply@freshmeat.net' => -3.0,
289 'owner-technews@postel.acm.org' => -3.0,
290 'ietf-123-owner@loki.ietf.org' => -3.0,
291 'cvs-commits-list-admin@gnome.org' => -3.0,
292 'rt-users-admin@lists.fsck.com' => -3.0,
293 'clp-request@comp.nus.edu.sg' => -3.0,
294 'surveys-errors@lists.nua.ie' => -3.0,
295 'emailnews@genomeweb.com' => -5.0,
296 'yahoo-dev-null@yahoo-inc.com' => -3.0,
297 'returns.groups.yahoo.com' => -3.0,
298 'clusternews@linuxnetworx.com' => -3.0,
299 lc('lvs-users-admin@LinuxVirtualServer.org') => -3.0,
300 lc('owner-textbreakingnews@CNNIMAIL12.CNN.COM') => -5.0,
301
302 # soft-blacklisting (positive score)
303 'sender@example.net' => 3.0,
304 '.example.net' => 1.0,
305
306 },
307 ], # end of site-wide tables
308 });
309
310
311 @decoders = (
312 ['mail', \&do_mime_decode],
313 ['asc', \&do_ascii],
314 ['uue', \&do_ascii],
315 ['hqx', \&do_ascii],
316 ['ync', \&do_ascii],
317 ['F', \&do_uncompress, ['unfreeze','freeze -d','melt','fcat'] ],
318 ['Z', \&do_uncompress, ['uncompress','gzip -d','zcat'] ],
319 ['gz', \&do_uncompress, 'gzip -d'],
320 ['gz', \&do_gunzip],
321 ['bz2', \&do_uncompress, 'bzip2 -d'],
322 ['lzo', \&do_uncompress, 'lzop -d'],
323 ['rpm', \&do_uncompress, ['rpm2cpio.pl','rpm2cpio'] ],
324 ['cpio', \&do_pax_cpio, ['pax','gcpio','cpio'] ],
325 ['tar', \&do_pax_cpio, ['pax','gcpio','cpio'] ],
326 ['deb', \&do_ar, 'ar'],
327 # ['a', \&do_ar, 'ar'], # unpacking .a seems an overkill
328 ['zip', \&do_unzip],
329 ['7z', \&do_7zip, ['7zr','7za','7z'] ],
330 ['rar', \&do_unrar, ['rar','unrar'] ],
331 ['arj', \&do_unarj, ['arj','unarj'] ],
332 ['arc', \&do_arc, ['nomarch','arc'] ],
333 ['zoo', \&do_zoo, ['zoo','unzoo'] ],
334 ['lha', \&do_lha, 'lha'],
335 # ['doc', \&do_ole, 'ripole'],
336 ['cab', \&do_cabextract, 'cabextract'],
337 ['tnef', \&do_tnef_ext, 'tnef'],
338 ['tnef', \&do_tnef],
339 # ['sit', \&do_unstuff, 'unstuff'], # broken/unsafe decoder
340 ['exe', \&do_executable, ['rar','unrar'], 'lha', ['arj','unarj'] ],
341 );
342
343
344 @av_scanners = (
345
346 # ### http://www.clanfield.info/sophie/ (http://www.vanja.com/tools/sophie/)
347 # ['Sophie',
348 # \&ask_daemon, ["{}/\n", '/var/run/sophie'],
349 # qr/(?x)^ 0+ ( : | [\000\r\n]* $)/, qr/(?x)^ 1 ( : | [\000\r\n]* $)/,
350 # qr/(?x)^ [-+]? \d+ : (.*?) [\000\r\n]* $/ ],
351
352 # ### http://www.csupomona.edu/~henson/www/projects/SAVI-Perl/
353 # ['Sophos SAVI', \&sophos_savi ],
354
355 # ### http://www.clamav.net/
356 # ['ClamAV-clamd',
357 # \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"],
358 # qr/\bOK$/, qr/\bFOUND$/,
359 # qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
360 # # NOTE: run clamd under the same user as amavisd, or run it under its own
361 # # uid such as clamav, add user clamav to the amavis group, and then add
362 # # AllowSupplementaryGroups to clamd.conf;
363 # # NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in
364 # # this entry; when running chrooted one may prefer socket "$MYHOME/clamd".
365
366 # ### http://www.clamav.net/ and CPAN (memory-hungry! clamd is preferred)
367 # # note that Mail::ClamAV requires perl to be build with threading!
368 # ['Mail::ClamAV', \&ask_clamav, "*", [0], [1], qr/^INFECTED: (.+)/],
369
370 # ### http://www.openantivirus.org/
371 # ['OpenAntiVirus ScannerDaemon (OAV)',
372 # \&ask_daemon, ["SCAN {}\n", '127.0.0.1:8127'],
373 # qr/^OK/, qr/^FOUND: /, qr/^FOUND: (.+)/ ],
374
375 # ### http://www.vanja.com/tools/trophie/
376 # ['Trophie',
377 # \&ask_daemon, ["{}/\n", '/var/run/trophie'],
378 # qr/(?x)^ 0+ ( : | [\000\r\n]* $)/, qr/(?x)^ 1 ( : | [\000\r\n]* $)/,
379 # qr/(?x)^ [-+]? \d+ : (.*?) [\000\r\n]* $/ ],
380
381 # ### http://www.grisoft.com/
382 # ['AVG Anti-Virus',
383 # \&ask_daemon, ["SCAN {}\n", '127.0.0.1:55555'],
384 # qr/^200/, qr/^403/, qr/^403 .*?: ([^\r\n]+)/ ],
385
386 # ### http://www.f-prot.com/
387 # ['FRISK F-Prot Daemon',
388 # \&ask_daemon,
389 # ["GET {}/*?-dumb%20-archive%20-packed HTTP/1.0\r\n\r\n",
390 # ['127.0.0.1:10200','127.0.0.1:10201','127.0.0.1:10202',
391 # '127.0.0.1:10203','127.0.0.1:10204'] ],
392 # qr/(?i)<summary[^>]*>clean<\/summary>/,
393 # qr/(?i)<summary[^>]*>infected<\/summary>/,
394 # qr/(?i)<name>(.+)<\/name>/ ],
395
396 # ### http://www.sald.com/, http://www.dials.ru/english/, http://www.drweb.ru/
397 # ['DrWebD', \&ask_daemon, # DrWebD 4.31 or later
398 # [pack('N',1). # DRWEBD_SCAN_CMD
399 # pack('N',0x00280001). # DONT_CHANGEMAIL, IS_MAIL, RETURN_VIRUSES
400 # pack('N', # path length
401 # length("$TEMPBASE/amavis-yyyymmddTHHMMSS-xxxxx/parts/pxxx")).
402 # '{}/*'. # path
403 # pack('N',0). # content size
404 # pack('N',0),
405 # '/var/drweb/run/drwebd.sock',
406 # # '/var/amavis/var/run/drwebd.sock', # suitable for chroot
407 # # '/usr/local/drweb/run/drwebd.sock', # FreeBSD drweb ports default
408 # # '127.0.0.1:3000', # or over an inet socket
409 # ],
410 # qr/\A\x00[\x10\x11][\x00\x10]\x00/s, # IS_CLEAN,EVAL_KEY; SKIPPED
411 # qr/\A\x00[\x00\x01][\x00\x10][\x20\x40\x80]/s, # KNOWN_V,UNKNOWN_V,V._MODIF
412 # qr/\A.{12}(?:infected with )?([^\x00]+)\x00/s,
413 # ],
414 # # NOTE: If using amavis-milter, change length to:
415 # # length("$TEMPBASE/amavis-milter-xxxxxxxxxxxxxx/parts/pxxx").
416
417 ### http://www.kaspersky.com/ (kav4mailservers)
418 ['KasperskyLab AVP - aveclient',
419 ['/usr/local/kav/bin/aveclient','/usr/local/share/kav/bin/aveclient',
420 '/opt/kav/5.5/kav4mailservers/bin/aveclient','aveclient'],
421 '-p /var/run/aveserver -s {}/*',
422 [0,3,6,8], qr/\b(INFECTED|SUSPICION|SUSPICIOUS)\b/,
423 qr/(?:INFECTED|WARNING|SUSPICION|SUSPICIOUS) (.+)/,
424 ],
425 # NOTE: one may prefer [0],[2,3,4,5], depending on how suspicious,
426 # currupted or protected archives are to be handled
427
428 ### http://www.kaspersky.com/
429 ['KasperskyLab AntiViral Toolkit Pro (AVP)', ['avp'],
430 '-* -P -B -Y -O- {}', [0,3,6,8], [2,4], # any use for -A -K ?
431 qr/infected: (.+)/,
432 sub {chdir('/opt/AVP') or die "Can't chdir to AVP: $!"},
433 sub {chdir($TEMPBASE) or die "Can't chdir back to $TEMPBASE $!"},
434 ],
435
436 ### The kavdaemon and AVPDaemonClient have been removed from Kasperky
437 ### products and replaced by aveserver and aveclient
438 ['KasperskyLab AVPDaemonClient',
439 [ '/opt/AVP/kavdaemon', 'kavdaemon',
440 '/opt/AVP/AvpDaemonClient', 'AvpDaemonClient',
441 '/opt/AVP/AvpTeamDream', 'AvpTeamDream',
442 '/opt/AVP/avpdc', 'avpdc' ],
443 "-f=$TEMPBASE {}", [0,8], [3,4,5,6], qr/infected: ([^\r\n]+)/ ],
444 # change the startup-script in /etc/init.d/kavd to:
445 # DPARMS="-* -Y -dl -f=/var/amavis /var/amavis"
446 # (or perhaps: DPARMS="-I0 -Y -* /var/amavis" )
447 # adjusting /var/amavis above to match your $TEMPBASE.
448 # The '-f=/var/amavis' is needed if not running it as root, so it
449 # can find, read, and write its pid file, etc., see 'man kavdaemon'.
450 # defUnix.prf: there must be an entry "*/var/amavis" (or whatever
451 # directory $TEMPBASE specifies) in the 'Names=' section.
452 # cd /opt/AVP/DaemonClients; configure; cd Sample; make
453 # cp AvpDaemonClient /opt/AVP/
454 # su - vscan -c "${PREFIX}/kavdaemon ${DPARMS}"
455
456 ### http://www.centralcommand.com/
457 ['CentralCommand Vexira (new) vascan',
458 ['vascan','/usr/lib/Vexira/vascan'],
459 "-a s --timeout=60 --temp=$TEMPBASE -y $QUARANTINEDIR ".
460 "--log=/var/log/vascan.log {}",
461 [0,3], [1,2,5],
462 qr/(?x)^\s* (?:virus|iworm|macro|mutant|sequence|trojan)\ found:\ ( [^\]\s']+ )\ \.\.\.\ / ],
463 # Adjust the path of the binary and the virus database as needed.
464 # 'vascan' does not allow to have the temp directory to be the same as
465 # the quarantine directory, and the quarantine option can not be disabled.
466 # If $QUARANTINEDIR is not used, then another directory must be specified
467 # to appease 'vascan'. Move status 3 to the second list if password
468 # protected files are to be considered infected.
469
470 ### http://www.avira.com/
471 ### Avira AntiVir (formerly H+BEDV) or (old) CentralCommand Vexira Antivirus
472 ['Avira AntiVir', ['antivir','vexira'],
473 '--allfiles -noboot -nombr -rs -s -z {}', [0], qr/ALERT:|VIRUS:/,
474 qr/(?x)^\s* (?: ALERT: \s* (?: \[ | [^']* ' ) |
475 (?i) VIRUS:\ .*?\ virus\ '?) ( [^\]\s']+ )/ ],
476 # NOTE: if you only have a demo version, remove -z and add 214, as in:
477 # '--allfiles -noboot -nombr -rs -s {}', [0,214], qr/ALERT:|VIRUS:/,
478
479 ### http://www.commandsoftware.com/
480 ['Command AntiVirus for Linux', 'csav',
481 '-all -archive -packed {}', [50], [51,52,53],
482 qr/Infection: (.+)/ ],
483
484 ### http://www.symantec.com/
485 ['Symantec CarrierScan via Symantec CommandLineScanner',
486 'cscmdline', '-a scan -i 1 -v -s 127.0.0.1:7777 {}',
487 qr/^Files Infected:\s+0$/, qr/^Infected\b/,
488 qr/^(?:Info|Virus Name):\s+(.+)/ ],
489
490 ### http://www.symantec.com/
491 ['Symantec AntiVirus Scan Engine',
492 'savsecls', '-server 127.0.0.1:7777 -mode scanrepair -details -verbose {}',
493 [0], qr/^Infected\b/,
494 qr/^(?:Info|Virus Name):\s+(.+)/ ],
495 # NOTE: check options and patterns to see which entry better applies
496
497 # ### http://www.f-secure.com/products/anti-virus/ version 4.65
498 # ['F-Secure Antivirus for Linux servers',
499 # ['/opt/f-secure/fsav/bin/fsav', 'fsav'],
500 # '--delete=no --disinf=no --rename=no --archive=yes --auto=yes '.
501 # '--dumb=yes --list=no --mime=yes {}', [0], [3,6,8],
502 # qr/(?:infection|Infected|Suspected): (.+)/ ],
503
504 ### http://www.f-secure.com/products/anti-virus/ version 5.52
505 ['F-Secure Antivirus for Linux servers',
506 ['/opt/f-secure/fsav/bin/fsav', 'fsav'],
507 '--virus-action1=report --archive=yes --auto=yes '.
508 '--dumb=yes --list=no --mime=yes {}', [0], [3,4,6,8],
509 qr/(?:infection|Infected|Suspected|Riskware): (.+)/ ],
510 # NOTE: internal archive handling may be switched off by '--archive=no'
511 # to prevent fsav from exiting with status 9 on broken archives
512
513 # ### http://www.avast.com/
514 # ['avast! Antivirus daemon',
515 # \&ask_daemon, # greets with 220, terminate with QUIT
516 # ["SCAN {}\015\012QUIT\015\012", '/var/run/avast4/mailscanner.sock'],
517 # qr/\t\[\+\]/, qr/\t\[L\]\t/, qr/\t\[L\]\t([^[ \t\015\012]+)/ ],
518
519 # ### http://www.avast.com/
520 # ['avast! Antivirus - Client/Server Version', 'avastlite',
521 # '-a /var/run/avast4/mailscanner.sock -n {}', [0], [1],
522 # qr/\t\[L\]\t([^[ \t\015\012]+)/ ],
523
524 ['CAI InoculateIT', 'inocucmd', # retired product
525 '-sec -nex {}', [0], [100],
526 qr/was infected by virus (.+)/ ],
527 # see: http://www.flatmtn.com/computer/Linux-Antivirus_CAI.html
528
529 ### http://www3.ca.com/Solutions/Product.asp?ID=156 (ex InoculateIT)
530 ['CAI eTrust Antivirus', 'etrust-wrapper',
531 '-arc -nex -spm h {}', [0], [101],
532 qr/is infected by virus: (.+)/ ],
533 # NOTE: requires suid wrapper around inocmd32; consider flag: -mod reviewer
534 # see http://marc.theaimsgroup.com/?l=amavis-user&m=109229779912783
535
536 ### http://mks.com.pl/english.html
537 ['MkS_Vir for Linux (beta)', ['mks32','mks'],
538 '-s {}/*', [0], [1,2],
539 qr/--[ \t]*(.+)/ ],
540
541 ### http://mks.com.pl/english.html
542 ['MkS_Vir daemon', 'mksscan',
543 '-s -q {}', [0], [1..7],
544 qr/^... (\S+)/ ],
545
546 # ### http://www.nod32.com/, version v2.52 and above
547 # ['ESET NOD32 for Linux Mail servers',
548 # ['/opt/eset/nod32/bin/nod32cli', 'nod32cli'],
549 # '--subdir --files -z --sfx --rtp --adware --unsafe --pattern --heur '.
550 # '-w -a --action-on-infected=accept --action-on-uncleanable=accept '.
551 # '--action-on-notscanned=accept {}',
552 # [0,3], [1,2], qr/virus="([^"]+)"/ ],
553
554 ### http://www.eset.com/, version v2.7
555 ['ESET NOD32 Linux Mail Server - command line interface',
556 ['/usr/bin/nod32cli', '/opt/eset/nod32/bin/nod32cli', 'nod32cli'],
557 '--subdir {}', [0,3], [1,2], qr/virus="([^"]+)"/ ],
558
559 ## http://www.nod32.com/, NOD32LFS version 2.5 and above
560 ['ESET NOD32 for Linux File servers',
561 ['/opt/eset/nod32/sbin/nod32','nod32'],
562 '--files -z --mail --sfx --rtp --adware --unsafe --pattern --heur '.
563 '-w -a --action=1 -b {}',
564 [0], [1,10], qr/^object=.*, virus="(.*?)",/ ],
565
566 # Experimental, based on posting from Rado Dibarbora (Dibo) on 2002-05-31
567 # ['ESET Software NOD32 Client/Server (NOD32SS)',
568 # \&ask_daemon2, # greets with 200, persistent, terminate with QUIT
569 # ["SCAN {}/*\r\n", '127.0.0.1:8448' ],
570 # qr/^200 File OK/, qr/^201 /, qr/^201 (.+)/ ],
571
572 ### http://www.norman.com/products_nvc.shtml
573 ['Norman Virus Control v5 / Linux', 'nvcc',
574 '-c -l:0 -s -u -temp:$TEMPBASE {}', [0,10,11], [1,2,14],
575 qr/(?i).* virus in .* -> \'(.+)\'/ ],
576
577 ### http://www.pandasoftware.com/
578 ['Panda CommandLineSecure 9 for Linux',
579 ['/opt/pavcl/usr/bin/pavcl','pavcl'],
580 '-auto -aex -heu -cmp -nbr -nor -nos -eng -nob {}',
581 qr/Number of files infected[ .]*: 0+(?!\d)/,
582 qr/Number of files infected[ .]*: 0*[1-9]/,
583 qr/Found virus :\s*(\S+)/ ],
584 # NOTE: for efficiency, start the Panda in resident mode with 'pavcl -tsr'
585 # before starting amavisd - the bases are then loaded only once at startup.
586 # To reload bases in a signature update script:
587 # /opt/pavcl/usr/bin/pavcl -tsr -ulr; /opt/pavcl/usr/bin/pavcl -tsr
588 # Please review other options of pavcl, for example:
589 # -nomalw, -nojoke, -nodial, -nohackt, -nospyw, -nocookies
590
591 # ### http://www.pandasoftware.com/
592 # ['Panda Antivirus for Linux', ['pavcl'],
593 # '-TSR -aut -aex -heu -cmp -nbr -nor -nso -eng {}',
594 # [0], [0x10, 0x30, 0x50, 0x70, 0x90, 0xB0, 0xD0, 0xF0],
595 # qr/Found virus :\s*(\S+)/ ],
596
597 # GeCAD AV technology is acquired by Microsoft; RAV has been discontinued.
598 # Check your RAV license terms before fiddling with the following two lines!
599 # ['GeCAD RAV AntiVirus 8', 'ravav',
600 # '--all --archive --mail {}', [1], [2,3,4,5], qr/Infected: (.+)/ ],
601 # # NOTE: the command line switches changed with scan engine 8.5 !
602 # # (btw, assigning stdin to /dev/null causes RAV to fail)
603
604 ### http://www.nai.com/
605 ['NAI McAfee AntiVirus (uvscan)', 'uvscan',
606 '--secure -rv --mime --summary --noboot - {}', [0], [13],
607 qr/(?x) Found (?:
608 \ the\ (.+)\ (?:virus|trojan) |
609 \ (?:virus|trojan)\ or\ variant\ ([^ ]+) |
610 :\ (.+)\ NOT\ a\ virus)/,
611 # sub {$ENV{LD_PRELOAD}='/lib/libc.so.6'},
612 # sub {delete $ENV{LD_PRELOAD}},
613 ],
614 # NOTE1: with RH9: force the dynamic linker to look at /lib/libc.so.6 before
615 # anything else by setting environment variable LD_PRELOAD=/lib/libc.so.6
616 # and then clear it when finished to avoid confusing anything else.
617 # NOTE2: to treat encrypted files as viruses replace the [13] with:
618 # qr/^\s{5,}(Found|is password-protected|.*(virus|trojan))/
619
620 ### http://www.virusbuster.hu/en/
621 ['VirusBuster', ['vbuster', 'vbengcl'],
622 "{} -ss -i '*' -log=$MYHOME/vbuster.log", [0], [1],
623 qr/: '(.*)' - Virus/ ],
624 # VirusBuster Ltd. does not support the daemon version for the workstation
625 # engine (vbuster-eng-1.12-linux-i386-libc6.tgz) any longer. The names of
626 # binaries, some parameters AND return codes have changed (from 3 to 1).
627 # See also the new Vexira entry 'vascan' which is possibly related.
628
629 # ### http://www.virusbuster.hu/en/
630 # ['VirusBuster (Client + Daemon)', 'vbengd',
631 # '-f -log scandir {}', [0], [3],
632 # qr/Virus found = (.*);/ ],
633 # # HINT: for an infected file it always returns 3,
634 # # although the man-page tells a different story
635
636 ### http://www.cyber.com/
637 ['CyberSoft VFind', 'vfind',
638 '--vexit {}/*', [0], [23], qr/##==>>>> VIRUS ID: CVDL (.+)/,
639 # sub {$ENV{VSTK_HOME}='/usr/lib/vstk'},
640 ],
641
642 ### http://www.avast.com/
643 ['avast! Antivirus', ['/usr/bin/avastcmd','avastcmd'],
644 '-a -i -n -t=A {}', [0], [1], qr/\binfected by:\s+([^ \t\n\[\]]+)/ ],
645
646 ### http://www.ikarus-software.com/
647 ['Ikarus AntiVirus for Linux', 'ikarus',
648 '{}', [0], [40], qr/Signature (.+) found/ ],
649
650 ### http://www.bitdefender.com/
651 ['BitDefender', 'bdc',
652 '--arc --mail {}', qr/^Infected files *:0+(?!\d)/,
653 qr/^(?:Infected files|Identified viruses|Suspect files) *:0*[1-9]/,
654 qr/(?:suspected|infected): (.*)(?:\033|$)/ ],
655 # consider also: --all --nowarn --alev=15 --flev=15. The --all argument may
656 # not apply to your version of bdc, check documentation and see 'bdc --help'
657
658 ### ArcaVir for Linux and Unix http://www.arcabit.pl/
659 ['ArcaVir for Linux', ['arcacmd','arcacmd.static'],
660 '-v 1 -summary 0 -s {}', [0], [1,2],
661 qr/(?:VIR|WIR):[ \t]*(.+)/ ],
662
663 # ['File::Scan', sub {Amavis::AV::ask_av(sub{
664 # use File::Scan; my($fn)=@_;
665 # my($f)=File::Scan->new(max_txt_size=>0, max_bin_size=>0);
666 # my($vname) = $f->scan($fn);
667 # $f->error ? (2,"Error: ".$f->error)
668 # : ($vname ne '') ? (1,"$vname FOUND") : (0,"Clean")}, @_) },
669 # ["{}/*"], [0], [1], qr/^(.*) FOUND$/ ],
670
671 # ### fully-fledged checker for JPEG marker segments of invalid length
672 # ['check-jpeg',
673 # sub { use JpegTester (); Amavis::AV::ask_av(\&JpegTester::test_jpeg, @_) },
674 # ["{}/*"], undef, [1], qr/^(bad jpeg: .*)$/ ],
675 # # NOTE: place file JpegTester.pm somewhere where Perl can find it,
676 # # for example in /usr/local/lib/perl5/site_perl
677
678 );
679
680
681 @av_scanners_backup = (
682
683 ### http://www.clamav.net/ - backs up clamd or Mail::ClamAV
684 ['ClamAV-clamscan', 'clamscan',
685 "--stdout --no-summary -r --tempdir=$TEMPBASE {}",
686 [0], qr/:.*\sFOUND$/, qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
687
688 ### http://www.f-prot.com/ - backs up F-Prot Daemon
689 ['FRISK F-Prot Antivirus', ['f-prot','f-prot.sh'],
690 '-dumb -archive -packed {}', [0,8], [3,6], # or: [0], [3,6,8],
691 qr/(?:Infection:|security risk named) (.+)|\s+contains\s+(.+)$/ ],
692
693 ### http://www.trendmicro.com/ - backs up Trophie
694 ['Trend Micro FileScanner', ['/etc/iscan/vscan','vscan'],
695 '-za -a {}', [0], qr/Found virus/, qr/Found virus (.+) in/ ],
696
697 ### http://www.sald.com/, http://drweb.imshop.de/ - backs up DrWebD
698 ['drweb - DrWeb Antivirus', # security LHA hole in Dr.Web 4.33 and earlier
699 ['/usr/local/drweb/drweb', '/opt/drweb/drweb', 'drweb'],
700 '-path={} -al -go -ot -cn -upn -ok-',
701 [0,32], [1,9,33], qr' infected (?:with|by)(?: virus)? (.*)$'],
702
703 ### http://www.kaspersky.com/
704 ['Kaspersky Antivirus v5.5',
705 ['/opt/kaspersky/kav4fs/bin/kav4fs-kavscanner',
706 '/opt/kav/5.5/kav4unix/bin/kavscanner',
707 '/opt/kav/5.5/kav4mailservers/bin/kavscanner', 'kavscanner'],
708 '-i0 -xn -xp -mn -R -ePASBME {}/*', [0,10,15], [5,20,21,25],
709 qr/(?:INFECTED|WARNING|SUSPICION|SUSPICIOUS) (.*)/ ,
710 # sub {chdir('/opt/kav/bin') or die "Can't chdir to kav: $!"},
711 # sub {chdir($TEMPBASE) or die "Can't chdir back to $TEMPBASE $!"},
712 ],
713
714 # Commented out because the name 'sweep' clashes with Debian and FreeBSD
715 # package/port of an audio editor. Make sure the correct 'sweep' is found
716 # in the path when enabling.
717 #
718 # ### http://www.sophos.com/ - backs up Sophie or SAVI-Perl
719 # ['Sophos Anti Virus (sweep)', 'sweep',
720 # '-nb -f -all -rec -ss -sc -archive -cab -mime -oe -tnef '.
721 # '--no-reset-atime {}',
722 # [0,2], qr/Virus .*? found/,
723 # qr/^>>> Virus(?: fragment)? '?(.*?)'? found/,
724 # ],
725 # # other options to consider: -idedir=/usr/local/sav
726
727 # always succeeds (uncomment to consider mail clean if all other scanners fail)
728 # ['always-clean', sub {0}],
729
730 );
731
732
733 1; # insure a defined return