---- amavisd-new-2.2.1/amavisd.conf-sample 2004-12-23 01:38:23.000000000 +0000
-+++ amavisd-new-2.2.1.new/amavisd.conf-sample 2004-12-23 20:18:27.372867424 +0000
-@@ -62,27 +62,31 @@
- # $MYHOME serves as a quick default for some other configuration settings.
- # More refined control is available with each individual setting further down.
- # $MYHOME is not used directly by the program. No trailing slash!
--#$MYHOME = '/var/lib/amavis'; # (default is '/var/amavis')
-+$MYHOME = '/var/spool/amavis'; # (default is '/var/amavis')
-
- # $mydomain serves as a quick default for some other configuration settings.
- # More refined control is available with each individual setting further down.
- # $mydomain is never used directly by the program.
--$mydomain = 'example.com'; # (no useful default)
-+#$mydomain = 'example.com'; # (no useful default)
-+
-+# This seems to be prefixed to host's domain name.
-+# You may get mail rejects of virus information as send from not
-+# existing host ( virusalert@localhost.whatever.your.domain.is )
-+$mydomain = 'mail.whatever.your.domain.is'; # (no useful default)
-
- # $myhostname = 'host.example.com'; # fqdn of this host, default by uname(3)
-
- # Set the user and group to which the daemon will change if started as root
- # (otherwise just keeps the UID unchanged, and these settings have no effect):
--$daemon_user = 'vscan'; # (no default; customary: vscan or amavis)
--$daemon_group = 'vscan'; # (no default; customary: vscan or amavis or sweep)
-+$daemon_user = 'amavis'; # (no default; customary: vscan or amavis)
-+$daemon_group = 'amavis'; # (no default; customary: vscan or amavis or sweep)
-
- # Runtime working directory (cwd), and a place where
- # temporary directories for unpacking mail are created.
- # (no trailing slash, may be a scratch file system)
--$TEMPBASE = $MYHOME; # (must be set if other config vars use is)
--#$TEMPBASE = "$MYHOME/tmp"; # prefer to keep home dir /var/amavis clean?
-+$TEMPBASE = "$MYHOME/runtime"; # (must be set if other config vars use is)
-
--#$db_home = "$MYHOME/db"; # DB databases directory, default "$MYHOME/db"
-+$db_home = "$MYHOME/db"; # DB databases directory, default "$MYHOME/db"
-
- # $helpers_home sets environment variable HOME, and is passed as option
- # 'home_dir_for_helpers' to Mail::SpamAssassin::new. It should be a directory
-@@ -111,6 +115,9 @@
- #$forward_method = 'smtp:[127.0.0.1]:10025'; # where to forward checked mail
- #$notify_method = $forward_method; # where to submit notifications
-
-+# @auth_mech_avail = ('PLAIN','LOGIN'); # empty list disables incoming AUTH
-+
-+
- # To make it possible for several hosts to share one content checking daemon,
- # the IP address and/or the port number in $forward_method and $notify_method
- # may be spacified as an asterisk. An asterisk in the colon-separated
-@@ -164,7 +171,7 @@
- # and see further down what these two lookup lists really mean.
- #
- # @bypass_virus_checks_maps = (1); # uncomment to DISABLE anti-virus code
--# @bypass_spam_checks_maps = (1); # uncomment to DISABLE anti-spam code
-+@bypass_spam_checks_maps = (1); # uncomment to DISABLE anti-spam code
- #
- # Any setting can be changed with a new assignment, so make sure
- # you do not unintentionally override these settings further down!
-@@ -279,7 +286,7 @@
- #$SYSLOG_LEVEL = 'user.info'; # (facility.priority, default 'mail.info')
-
- # Log file (if not using syslog)
--$LOGFILE = "$MYHOME/amavis.log"; # (defaults to empty, no log)
-+# $LOGFILE = "$MYHOME/amavis.log"; # (defaults to empty, no log)
-
- #NOTE: levels are not strictly observed and are somewhat arbitrary
- # 0: startup/exit/failure messages, viruses detected
-@@ -288,7 +295,8 @@
- # 3: server, client
- # 4: decompose parts
- # 5: more debug details
--$log_level = 2; # (defaults to 0)
-+# $log_level = 2; # (defaults to 0)
-+
-
- # Customizable template for the most interesting log file entry (e.g. with
- # $log_level=0) (take care to properly quote Perl special characters like '\')
-@@ -471,22 +479,22 @@
- # Bounces or rejects produce non-delivery status notification regardless.
-
- # Notify virus sender?
--#$warnvirussender = 1; # (defaults to false (undef))
-+$warnvirussender = 1; # (defaults to false (undef))
-
- # Notify spam sender?
--#$warnspamsender = 1; # (defaults to false (undef))
-+$warnspamsender = 1; # (defaults to false (undef))
-
- # Notify sender of banned files?
--#$warnbannedsender = 1; # (defaults to false (undef))
-+$warnbannedsender = 1; # (defaults to false (undef))
-
- # Notify sender of syntactically invalid header containing non-ASCII characters?
--#$warnbadhsender = 1; # (defaults to false (undef))
-+# $warnbadhsender = 1; # (defaults to false (undef))
-
- # Notify virus (or banned files or bad headers) RECIPIENT?
- # (not very useful, but some policies demand it)
--#$warnvirusrecip = 1; # (defaults to false (undef))
--#$warnbannedrecip = 1; # (defaults to false (undef))
--#$warnbadhrecip = 1; # (defaults to false (undef))
-+$warnvirusrecip = 1; # (defaults to false (undef))
-+$warnbannedrecip = 1; # (defaults to false (undef))
-+$warnbadhrecip = 1; # (defaults to false (undef))
-
- # Notify also non-local virus/banned recipients if $warn*recip is true?
- # (including those not matching local_domains*)
-@@ -587,7 +595,8 @@
- # or a directory (no trailing slash)
- # (the default value is undef, meaning no quarantine)
- #
--$QUARANTINEDIR = '/var/virusmails';
-+# $QUARANTINEDIR = '/var/virusmails';
-+$QUARANTINEDIR = '/var/spool/amavis/virusmails';
-
- #$virus_quarantine_method = 'local:virus-%i-%n'; # default
- #$spam_quarantine_method = 'local:spam-%b-%i-%n'; # default
-@@ -1600,13 +1609,12 @@
- # ['Sophos SAVI', \&sophos_savi ],
-
- # ### http://www.clamav.net/
+diff -urp amavis-v2.12.1.orig/amavisd.conf amavis-v2.12.1/amavisd.conf
+--- amavis-v2.12.1.orig/amavisd.conf 2020-11-13 13:55:37.000000000 +0100
++++ amavis-v2.12.1/amavisd.conf 2021-01-24 21:25:54.841592502 +0100
+@@ -10,32 +10,32 @@ use strict;
+ # COMMONLY ADJUSTED SETTINGS:
+
+ # @bypass_virus_checks_maps = (1); # controls running of anti-virus code
+-# @bypass_spam_checks_maps = (1); # controls running of anti-spam code
++@bypass_spam_checks_maps = (1); # controls running of anti-spam code
+ # $bypass_decode_parts = 1; # controls running of decoders&dearchivers
+
+ # $myprogram_name = $0; # set to 'amavisd' or similar to avoid process name
+ # truncation in /proc/<pid>/stat and ps -e output
+
+ $max_servers = 2; # num of pre-forked children (2..30 is common), -m
+-$daemon_user = 'vscan'; # (no default; customary: vscan or amavis), -u
+-$daemon_group = 'vscan'; # (no default; customary: vscan or amavis), -g
++$daemon_user = 'amavis'; # (no default; customary: vscan or amavis), -u
++$daemon_group = 'amavis'; # (no default; customary: vscan or amavis), -g
+
+ $mydomain = 'example.com'; # a convenient default for other settings
+
+-# $MYHOME = '/var/amavis'; # a convenient default for other settings, -H
+-$TEMPBASE = "$MYHOME/tmp"; # working directory, needs to exist, -T
++$MYHOME = '/var/spool/amavis'; # a convenient default for other settings, -H
++$TEMPBASE = "$MYHOME/runtime"; # working directory, needs to exist, -T
+ $ENV{TMPDIR} = $TEMPBASE; # environment variable TMPDIR, used by SA, etc.
+-$QUARANTINEDIR = '/var/virusmails'; # -Q
++$QUARANTINEDIR = '/var/spool/amavis/virusmails'; # -Q
+ # $quarantine_subdir_levels = 1; # add level of subdirs to disperse quarantine
+ # $release_format = 'resend'; # 'attach', 'plain', 'resend'
+ # $report_format = 'arf'; # 'attach', 'plain', 'resend', 'arf'
+
+ # $daemon_chroot_dir = $MYHOME; # chroot directory or undef, -R
+
+-# $db_home = "$MYHOME/db"; # dir for bdb nanny/cache/snmp databases, -D
++$db_home = "$MYHOME/db"; # dir for bdb nanny/cache/snmp databases, -D
+ # $helpers_home = "$MYHOME/var"; # working directory for SpamAssassin, -S
+-# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
+-# $pid_file = "$MYHOME/var/amavisd.pid"; # -P
++$lock_file = "/var/run/amavisd/amavisd.lock"; # -L
++$pid_file = "/var/run/amavisd/amavisd.pid"; # -P
+ #NOTE: create directories $MYHOME/tmp, $MYHOME/var, $MYHOME/db manually
+
+ $log_level = 0; # verbosity 0..5, -d
+@@ -55,7 +55,8 @@ $enable_dkim_signing = 1; # load DKIM
+ @mynetworks = qw( 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10
+ 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 );
+
+-$unix_socketname = "$MYHOME/amavisd.sock"; # amavisd-release or amavis-milter
++#$unix_socketname = "/var/run/amavisd/amavisd.sock"; # amavisd-release or amavis-milter
++$unix_socketname = undef; # disable listening on a unix socket
+ # option(s) -p overrides $inet_socket_port and $unix_socketname
+
+ $inet_socket_port = 10024; # listen on this local TCP port(s)
+@@ -382,16 +383,15 @@ $banned_filename_re = new_RE(
+ # qr/^(?:310|420)[,\s]*(?:.* <<< )?(.+?)(?: ; |$)/m ],
+ # settings for the SAVAPI3.conf: ArchiveScan=1, HeurLevel=2, MailboxScan=1
+
+-# ### http://www.clamav.net/
-# ['ClamAV-clamd',
--# \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"],
--# qr/\bOK$/, qr/\bFOUND$/,
--# qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
--# # NOTE: the easiest is to run clamd under the same user as amavisd; match the
--# # socket name (LocalSocket) in clamav.conf to the socket name in this entry
--# # When running chrooted one may prefer: ["CONTSCAN {}\n","$MYHOME/clamd"],
-+ ['Clam Antivirus-clamd',
-+ \&ask_daemon, ["CONTSCAN {}\n", '/var/lib/clamav/clamd.socket'],
-+ qr/\bOK$/, qr/\bFOUND$/,
-+ qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
-+
-+# NOTE: match the socket name in clamav.conf to the socket name in this entry
+-# \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"],
+-# qr/\bOK$/m, qr/\bFOUND$/m,
+-# qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ],
+-# # NOTE: run clamd under the same user as amavisd - or run it under its own
+-# # uid such as clamav, add user clamav to the amavis group, and then add
+-# # AllowSupplementaryGroups to clamd.conf;
+-# # NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in
+-# # this entry; when running chrooted one may prefer a socket under $MYHOME.
++['ClamAV-clamd',
++ \&ask_daemon, ["CONTSCAN {}\n", "/var/lib/clamav/clamd.socket"],
++ qr/\bOK$/, qr/\bFOUND$/,
++ qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
++# NOTE: run clamd under the same user as amavisd - or run it under its own
++# uid such as clamav, add user clamav to the amavis group, and then add
++# AllowSupplementaryGroups to clamd.conf;
++# NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in
++# this entry; when running chrooted one may prefer a socket under $MYHOME.
# ### http://www.clamav.net/ and CPAN (memory-hungry! clamd is preferred)
- # ['Mail::ClamAV', \&ask_clamav, "*", [0], [1], qr/^INFECTED: (.+)/],
-@@ -1740,10 +1748,11 @@
+ # # note that Mail::ClamAV requires perl to be build with threading!
+@@ -580,16 +580,21 @@ $banned_filename_re = new_RE(
# NOTE: requires suid wrapper around inocmd32; consider flag: -mod reviewer
# see http://marc.theaimsgroup.com/?l=amavis-user&m=109229779912783
- ### http://mks.com.pl/english.html
- ['MkS_Vir for Linux (beta)', ['mks32','mks'],
- '-s {}/*', [0], [1,2],
-- qr/--[ \t]*(.+)/ ],
+- qr/--[ \t]*(.+)/m ],
+# Moved to secondary scanner
+# ### http://mks.com.pl/english.html
+# ['MkS_Vir for Linux (beta)', ['mks32','mks'],
+# '-s {}/*', [0], [1,2],
-+# qr/--[ \t]*(.+)/ ],
++# qr/--[ \t]*(.+)/m ],
### http://mks.com.pl/english.html
['MkS_Vir daemon', 'mksscan',
-@@ -1938,6 +1947,11 @@
- # ],
- # # other options to consider: -mime -oe -idedir=/usr/local/sav
+ '-s -q {}', [0], [1..7],
+ qr/^... (\S+)/m ],
-+ ['MkS_Vir for Linux (beta)', ['mks32','mks'],
-+ '-s {}/*', [0], [1,2],
-+ qr/--[ \t]*(.+)/ ],
-+
++ ['MkS_Vir for Linux (beta)', ['mks32','mks'],
++ '-s {}/*', [0], [1,2],
++ qr/--[ \t]*(.+)/m ],
+
- # always succeeds (uncomment to consider mail clean if all other scanners fail)
- # ['always-clean', sub {0}],
-
+ # ### http://www.nod32.com/, version v2.52 (old)
+ # ['ESET NOD32 for Linux Mail servers',
+ # ['/opt/eset/nod32/bin/nod32cli', 'nod32cli'],