# [solved] postfix discarding spam?

## Strowi

hi,

i recently installed postfix on our LAN-server (following mostly the wiki-tutorial).

Everything works, amavisd,spamassassin,clamav..., but i have a single problem:

Postfix discards some mails, that are nowhere to be found again.. when i use fetchmail to get some mails delivered to the local account, for some mails i get the following log-entry:

```

Apr  6 12:34:04 Baal postfix/smtp[14106]: 862CB9C895: to=<strowi@localhost.xyz.gotdns.org>, orig_to=<strowi@localhost>, relay=127.0.0.1[127.0.0.1]:10024, delay=57, delays=9.3/0.05/0.09/48, dsn=2.7.0, status=sent (254 2.7.0 Ok, discarded, id=09910-01 - SPAM)

```

Can anyone help me with this one? I already looked through the postfix and amavisd config, but couldn't figure this out... I only want to tag SPAM without taking evasive actions like discarding....

Any help would be greatly appreciated.

Here are the configs:

/etc/amavisd.conf

```
use strict;

$MYHOME = '/var/amavis';   # (default is '/var/amavis'), -H

$mydomain = 'baal.gotdns.org';      # (no useful default)

$myhostname = 'baal.gotdns.org';  # fqdn of this host, default by uname(3)

$daemon_user  = 'amavis';   # (no default;  customary: vscan or amavis), -u

$daemon_group = 'amavis';   # (no default;  customary: vscan or amavis), -g

$TEMPBASE = "$MYHOME/tmp";     # prefer to keep home dir /var/amavis clean?

$helpers_home = $MYHOME;   # (defaults to $MYHOME), -S

$ENV{TMPDIR} = $TEMPBASE;       # wise to set TMPDIR, but not obligatory

$enable_db = 1;              # enable use of BerkeleyDB/libdb (SNMP and nanny)

$enable_global_cache = 1;    # enable use of libdb-based cache if $enable_db=1

$forward_method = 'smtp:[127.0.0.1]:10025';  # where to forward checked mail

$max_servers  =  4;   # number of pre-forked children          (default 2), -m

$max_requests = 20;   # retire a child after that many accepts (default 20)

$child_timeout=5*60;  # abort child if it does not complete its processing in

$smtpd_timeout = 120; # disconnect session if client is idle for too long

@local_domains_maps = ( [".$mydomain"] );  # $mydomain and its subdomains

                   # (does not apply to sendmail/milter)

                   # (default is true)

$inet_socket_port = 10024;        # accept SMTP on this local TCP port

$inet_socket_bind = '127.0.0.1'; # limit socket bind to loopback interface

@inet_acl = qw(127.0.0.1 [::1]);  # allow SMTP access only from localhost IP

$DO_SYSLOG = 1;                   # (defaults to 0)

$syslog_ident = 'amavis';     # Syslog ident string (defaults to 'amavis')

$syslog_facility = 'mail';    # Syslog facility as a string

$syslog_priority = 'notice';   # Syslog base (minimal) priority as a string,

$LOGFILE = "$MYHOME/amavis.log";  # (defaults to empty, no log)

$log_level = 5;         # (defaults to 0), -d

$log_recip_templ = undef;  # undef disables by-recipient level-0 log entries

$final_virus_destiny      = D_PASS; # (defaults to D_DISCARD)

$final_banned_destiny     = D_PASS;  # (defaults to D_BOUNCE)

$final_spam_destiny       = D_PASS;  # (defaults to D_BOUNCE)

$final_bad_header_destiny = D_PASS;    # (defaults to D_PASS)

%final_destiny_by_ccat = (

  CC_VIRUS,      D_PASS,

  CC_BANNED,     D_BOUNCE,

  CC_UNCHECKED,  D_PASS,

  CC_SPAM,       D_PASS,

  CC_BADH,       D_PASS,

  CC_OVERSIZED,  D_BOUNCE,

  CC_CLEAN,      D_PASS,

  CC_CATCHALL,   D_PASS,

);

@viruses_that_fake_sender_maps = (new_RE(

  qr'nimda|hybris|klez|bugbear|yaha|braid|sobig|fizzer|palyh|peido|holar'i,

  qr'tanatos|lentin|bridex|mimail|trojan\.dropper|dumaru|parite|spaces'i,

  qr'dloader|galil|gibe|swen|netwatch|bics|sbrowse|sober|rox|val(hal)?la'i,

  qr'frethem|sircam|be?agle|tanx|mydoom|novarg|shimg|netsky|somefool|moodown'i,

  qr'@mm|@MM',    # mass mailing viruses as labeled by f-prot and uvscan

  qr'Worm'i,      # worms as labeled by ClamAV, Kaspersky, etc

  [qr/^/ => 1],   # true by default  (remove or comment-out if undesired)

));

$virus_admin = "virusalert\@$mydomain";

$mailfrom_notify_admin     = "virusalert\@$mydomain";

$mailfrom_notify_recip     = "virusalert\@$mydomain";

$mailfrom_notify_spamadmin = "spam.police\@$mydomain";

$undecipherable_subject_tag = '***UNCHECKED*** ';  # undef disables it

$defang_virus  = 1;  # default is false: don't modify mail body

$defang_banned = 1;  # default is false: don't modify mail body

$remove_existing_x_scanned_headers = 0; # leave existing X-Virus-Scanned alone

               # (defaults to false)

$remove_existing_x_scanned_headers= 1; # remove existing X-Virus-Scanned

$remove_existing_spam_headers = 0;     # leave existing X-Spam* headers alone

$remove_existing_spam_headers  = 1;     # remove existing spam headers if

               # spam scanning is enabled (default)

$banned_filename_re = new_RE(

  qr'^\.(exe-ms|dll)$',                   # banned file(1) types, rudimentary

  [ qr'^\.(rpm|cpio|tar)$'       => 0 ],  # allow any in Unix-type archives

  qr'.\.(pif|scr)$'i,                     # banned extensions - rudimentary

  qr'^application/x-msdownload$'i,        # block these MIME types

  qr'^application/x-msdos-program$'i,

  qr'^application/hta$'i,

  qr'\.[^./]*[A-Za-z][^./]*\.\s*(exe|vbs|pif|scr|bat|cmd|com|cpl|dll)[.\s]*$'i,

  qr'.\.(exe|vbs|pif|scr|cpl)$'i,             # banned extension - basic

);

$banned_namepath_re = new_RE(

  qr'(?# BLOCK Microsoft EXECUTABLES and DLL )

     ^ (.*\t)? T=(exe-ms|dll) (\t.*)? $'xm, # banned file(1) types, rudimentary

  [ qr'(?#rule-4) ^ (.*\t)? T=(tar|rpm|cpio) (\t.*)? $'xmi => 0 ],  # allow

  qr'(?# BLOCK COMMON NAME EXENSIONS )

     ^ (.*\t)? N= [^\t\n]* \. (pif|scr) (\t.*)? $'xmi,

  qr'(?#NO X-MSDOWNLOAD)   ^(.*\t)? M=application/x-msdownload   (\t.*)? $'xmi,

  qr'(?#NO X-MSDOS-PROGRAM)^(.*\t)? M=application/x-msdos-program(\t.*)? $'xmi,

  qr'(?#NO HTA)            ^(.*\t)? M=application/hta            (\t.*)? $'xmi,

  qr'(?# BLOCK DOUBLE-EXTENSIONS )

     ^ (.*\t)? N= [^\t\n]* \. [^./\t\n]* [A-Za-z] [^./\t\n]* \. \ *

                  (exe|vbs|pif|scr|bat|cmd|com|cpl|dll) [. ]* (\t.*)? $'xmi,

  [ qr'(?# BLOCK EMPTY MIME PART APPLICATION/OCTET-STREAM )

       ^ (.*\t)? M=application/(octet-stream|x-msdownload|x-msdos-program)

       \t(.*\t)* T=empty (\t.*)? $'xmi

    => 'DISCARD' ],

  qr'(?# BLOCK COMMON NAME EXENSIONS )

     ^ (.*\t)? N= [^\t\n]* \. (exe|vbs|pif|scr|cpl) (\t.*)? $'xmi,

);

  $banned_namepath_re = undef;  # to disable new-style

%banned_rules = (

  'MYNETS-DEFAULT' => new_RE(   # permissive set of rules for internal hosts

    [ qr'^\.(rpm|cpio|tar)$' => 0 ],  # allow any name/type in Unix archives

    qr'.\.(vbs|pif|scr)$'i,     # banned extension - rudimentary

  ),

  'DEFAULT' => $banned_filename_re,

);

$sql_select_white_black_list = undef;  # undef disables SQL white/blacklisting

$localpart_is_case_sensitive = 0;   # (default is false)

@score_sender_maps = ({  # a by-recipient hash lookup table

  '.' => [  # the _first_ matching sender determines the score boost

   new_RE(  # regexp-type lookup table, just happens to be all soft-blacklist

    [qr'^(bulkmail|offers|cheapbenefits|earnmoney|foryou)@'i         => 5.0],

    [qr'^(greatcasino|investments|lose_weight_today|market\.alert)@'i=> 5.0],

    [qr'^(money2you|MyGreenCard|new\.tld\.registry|opt-out|opt-in)@'i=> 5.0],

    [qr'^(optin|saveonlsmoking2002k|specialoffer|specialoffers)@'i   => 5.0],

    [qr'^(stockalert|stopsnoring|wantsome|workathome|yesitsfree)@'i  => 5.0],

    [qr'^(your_friend|greatoffers)@'i                                => 5.0],

    [qr'^(inkjetplanet|marketopt|MakeMoney)\d*@'i                    => 5.0],

   ),

   { # a hash-type lookup table (associative array)

     'nobody@cert.org'                        => -3.0,

     'cert-advisory@us-cert.gov'              => -3.0,

     'owner-alert@iss.net'                    => -3.0,

     'slashdot@slashdot.org'                  => -3.0,

     'securityfocus.com'                      => -3.0,

     'ntbugtraq@listserv.ntbugtraq.com'       => -3.0,

     'security-alerts@linuxsecurity.com'      => -3.0,

     'mailman-announce-admin@python.org'      => -3.0,

     'amavis-user-admin@lists.sourceforge.net'=> -3.0,

     'amavis-user-bounces@lists.sourceforge.net' => -3.0,

     'spamassassin.apache.org'                => -3.0,

     'notification-return@lists.sophos.com'   => -3.0,

     'owner-postfix-users@postfix.org'        => -3.0,

     'owner-postfix-announce@postfix.org'     => -3.0,

     'owner-sendmail-announce@lists.sendmail.org'   => -3.0,

     'sendmail-announce-request@lists.sendmail.org' => -3.0,

     'donotreply@sendmail.org'                => -3.0,

     'ca+envelope@sendmail.org'               => -3.0,

     'noreply@freshmeat.net'                  => -3.0,

     'owner-technews@postel.acm.org'          => -3.0,

     'ietf-123-owner@loki.ietf.org'           => -3.0,

     'cvs-commits-list-admin@gnome.org'       => -3.0,

     'rt-users-admin@lists.fsck.com'          => -3.0,

     'clp-request@comp.nus.edu.sg'            => -3.0,

     'surveys-errors@lists.nua.ie'            => -3.0,

     'emailnews@genomeweb.com'                => -5.0,

     'yahoo-dev-null@yahoo-inc.com'           => -3.0,

     'returns.groups.yahoo.com'               => -3.0,

     'clusternews@linuxnetworx.com'           => -3.0,

     lc('lvs-users-admin@LinuxVirtualServer.org')    => -3.0,

     lc('owner-textbreakingnews@CNNIMAIL12.CNN.COM') => -5.0,

     'sender@example.net'                     =>  3.0,

     '.example.net'                           =>  1.0,

   },

  ],  # end of site-wide tables

});

@blacklist_sender_maps = ( new_RE(

    qr'^(bulkmail|offers|cheapbenefits|earnmoney|foryou|greatcasino)@'i,

    qr'^(investments|lose_weight_today|market\.alert|money2you|MyGreenCard)@'i,

    qr'^(new\.tld\.registry|opt-out|opt-in|optin|saveonlsmoking2002k)@'i,

    qr'^(specialoffer|specialoffers|stockalert|stopsnoring|wantsome)@'i,

    qr'^(workathome|yesitsfree|your_friend|greatoffers)@'i,

    qr'^(inkjetplanet|marketopt|MakeMoney)\d*@'i,

));

$MAXLEVELS = 14;      # (default is undef, no limit)

$MAXFILES = 1500;      # (default is undef, no limit)

$MIN_EXPANSION_QUOTA =      100*1024;  # bytes  (default undef, not enforced)

$MAX_EXPANSION_QUOTA = 300*1024*1024;  # bytes  (default undef, not enforced)

$MIN_EXPANSION_FACTOR =   5;  # times original mail size  (default is 5)

$MAX_EXPANSION_FACTOR = 500;  # times original mail size  (default is 500)

$virus_check_negative_ttl=  3*60; # time to remember that mail was not infected

$virus_check_positive_ttl= 30*60; # time to remember that mail was infected

$spam_check_negative_ttl = 10*60; # time to remember that mail was not spam

$spam_check_positive_ttl = 30*60; # time to remember that mail was spam

$path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin:/opt/bin';

$file   = 'file';   # file(1) utility; use 3.41 or later to avoid vulnerability

$dspam  = 'dspam';

@decoders = (

  ['mail', \&do_mime_decode],

  ['asc',  \&do_ascii],

  ['uue',  \&do_ascii],

  ['hqx',  \&do_ascii],

  ['ync',  \&do_ascii],

  ['F',    \&do_uncompress, ['unfreeze','freeze -d','melt','fcat'] ],

  ['Z',    \&do_uncompress, ['uncompress','gzip -d','zcat'] ],

  ['gz',   \&do_uncompress,  'gzip -d'],

  ['gz',   \&do_gunzip],

  ['bz2',  \&do_uncompress,  'bzip2 -d'],

  ['lzo',  \&do_uncompress,  'lzop -d'],

  ['rpm',  \&do_uncompress, ['rpm2cpio.pl','rpm2cpio'] ],

  ['cpio', \&do_pax_cpio,   ['pax','gcpio','cpio'] ],

  ['tar',  \&do_pax_cpio,   ['pax','gcpio','cpio'] ],

  ['tar',  \&do_tar],

  ['deb',  \&do_ar,          'ar'],

  ['zip',  \&do_unzip],

  ['rar',  \&do_unrar,      ['rar','unrar'] ],

  ['arj',  \&do_unarj,      ['arj','unarj'] ],

  ['arc',  \&do_arc,        ['nomarch','arc'] ],

  ['zoo',  \&do_zoo,        ['zoo','unzoo'] ],

  ['lha',  \&do_lha,         'lha'],

  ['cab',  \&do_cabextract,  'cabextract'],

  ['tnef', \&do_tnef_ext,    'tnef'],

  ['tnef', \&do_tnef],

  ['exe',  \&do_executable, ['rar','unrar'], 'lha', ['arj','unarj'] ],

);

$sa_local_tests_only = 0;   # only tests which do not require internet access?

$sa_auto_whitelist = 1;    # turn on AWL in SA 2.63 or older (irrelevant

$sa_mail_body_size_limit = 400*1024; # don't waste time on SA if mail is larger

             # (less than 1% of spam is > 64k)

             # default: undef, no limitations

$sa_tag_level_deflt  = -10; # add spam info headers if at, or above that level;

             # undef is interpreted as lower than any spam level

$sa_tag2_level_deflt = 5   ;# add 'spam detected' headers at that level to

             # at or above that level: bounce/reject/drop,

             # quarantine

$sa_dsn_cutoff_level = 20;   # spam level beyond which a DSN is not sent,

@spam_dsn_cutoff_level_bysender_maps = (

  { # an associative array (hash) lookup table, use lowercase keys

    'virgilio.it' => 7,  'mail.ru'     => 7,  '0451.com' => 7,

    'yahoo.co.uk' => 7,  'yahoo.co.jp' => 7,  'nobody@'  => 7,

    'noreply@'    => 0,  'no-reply@'   => 0,  'donotreply@'     => 0,

    'opt-in@'     => 0,  'opt-out@'    => 0,  'yahoo-dev-null@' => 0,

    '.optin-out.com' => 0,  'daily@astrocenter.com' => 0,

    'spamadmin@fraunhofer.de'=> 7,  # Sophos PureMessage spam bounces

  },

  \$sa_dsn_cutoff_level,  # catchall default value

);

$sa_spam_subject_tag = '***SPAM*** ';   # (defaults to undef, disabled)

              # (only seen when spam is passed and recipient is

$sa_spam_modifies_subj = 1; # in @spam_modifies_subj_maps, default is true

              # undef or empty disables inserting X-Spam-Level

$sa_spam_report_header = 1; # insert X-Spam-Report header field? default false

$first_infected_stops_scan = 1;  # default is false, all scanners in a section

@av_scanners = (

 ['ClamAV-clamd',

   \&ask_daemon, ["CONTSCAN {}\n", "/var/amavis/clamd.sock"],

   qr/\bOK$/, qr/\bFOUND$/,

   qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],

  ['KasperskyLab AVP - aveclient',

    ['/usr/local/kav/bin/aveclient','/usr/local/share/kav/bin/aveclient',

     '/opt/kav/5.5/kav4mailservers/bin/aveclient','aveclient'],

    '-p /var/run/aveserver -s {}/*',

    [0,3,6,8], qr/\b(INFECTED|SUSPICION|SUSPICIOUS)\b/,

    qr/(?:INFECTED|WARNING|SUSPICION|SUSPICIOUS) (.+)/,

  ],

  ['KasperskyLab AntiViral Toolkit Pro (AVP)', ['avp'],

    '-* -P -B -Y -O- {}', [0,3,6,8], [2,4],    # any use for -A -K   ?

    qr/infected: (.+)/,

    sub {chdir('/opt/AVP') or die "Can't chdir to AVP: $!"},

    sub {chdir($TEMPBASE) or die "Can't chdir back to $TEMPBASE $!"},

  ],

  ['KasperskyLab AVPDaemonClient',

    [ '/opt/AVP/kavdaemon',       'kavdaemon',

      '/opt/AVP/AvpDaemonClient', 'AvpDaemonClient',

      '/opt/AVP/AvpTeamDream',    'AvpTeamDream',

      '/opt/AVP/avpdc', 'avpdc' ],

    "-f=$TEMPBASE {}", [0,8], [3,4,5,6], qr/infected: ([^\r\n]+)/ ],

  ['CentralCommand Vexira (new) vascan',

    ['vascan','/usr/lib/Vexira/vascan'],

    "-a s --timeout=60 --temp=$TEMPBASE -y $QUARANTINEDIR ".

    "--log=/var/log/vascan.log {}",

    [0,3], [1,2,5],

    qr/(?x)^\s* (?:virus|iworm|macro|mutant|sequence|trojan)\ found:\ ( [^\]\s']+ )\ \.\.\.\ / ],

  ['Avira AntiVir', ['antivir','vexira'],

    '--allfiles -noboot -nombr -rs -s -z {}', [0], qr/ALERT:|VIRUS:/,

    qr/(?x)^\s* (?: ALERT: \s* (?: \[ | [^']* ' ) |

         (?i) VIRUS:\ .*?\ virus\ '?) ( [^\]\s']+ )/ ],

  ['Command AntiVirus for Linux', 'csav',

    '-all -archive -packed {}', [50], [51,52,53],

    qr/Infection: (.+)/ ],

  ['Symantec CarrierScan via Symantec CommandLineScanner',

    'cscmdline', '-a scan -i 1 -v -s 127.0.0.1:7777 {}',

    qr/^Files Infected:\s+0$/, qr/^Infected\b/,

    qr/^(?:Info|Virus Name):\s+(.+)/ ],

  ['Symantec AntiVirus Scan Engine',

    'savsecls', '-server 127.0.0.1:7777 -mode scanrepair -details -verbose {}',

    [0], qr/^Infected\b/,

    qr/^(?:Info|Virus Name):\s+(.+)/ ],

   ['F-Secure Antivirus for Linux servers',

    ['/opt/f-secure/fsav/bin/fsav', 'fsav'],

    '--delete=no --disinf=no --rename=no --archive=yes --auto=yes '.

    '--dumb=yes --list=no --mime=yes {}', [0], [3,6,8],

    qr/(?:infection|Infected|Suspected): (.+)/ ],

  ['CAI InoculateIT', 'inocucmd',  # retired product

    '-sec -nex {}', [0], [100],

    qr/was infected by virus (.+)/ ],

  ['CAI eTrust Antivirus', 'etrust-wrapper',

    '-arc -nex -spm h {}', [0], [101],

    qr/is infected by virus: (.+)/ ],

  ['MkS_Vir for Linux (beta)', ['mks32','mks'],

    '-s {}/*', [0], [1,2],

    qr/--[ \t]*(.+)/ ],

  ['MkS_Vir daemon', 'mksscan',

    '-s -q {}', [0], [1..7],

    qr/^... (\S+)/ ],

  ['ESET NOD32 for Linux Mail servers',

    ['/opt/eset/nod32/bin/nod32cli', 'nod32cli'],

     '--subdir --files -z --sfx --rtp --adware --unsafe --pattern --heur '.

     '-w -a --action-on-infected=accept --action-on-uncleanable=accept '.

     '--action-on-notscanned=accept {}',

    [0,3], [1,2], qr/virus="([^"]+)"/ ],

  ['ESET NOD32 for Linux File servers',

    ['/opt/eset/nod32/sbin/nod32','nod32'],

    '--files -z --mail --sfx --rtp --adware --unsafe --pattern --heur '.

    '-w -a --action=1 -b {}',

    [0], [1,10], qr/^object=.*, virus="(.*?)",/ ],

  ['Norman Virus Control v5 / Linux', 'nvcc',

    '-c -l:0 -s -u -temp:$TEMPBASE {}', [0,10,11], [1,2,14],

    qr/(?i).* virus in .* -> \'(.+)\'/ ],

  ['Panda CommandLineSecure 9 for Linux',

    ['/opt/pavcl/usr/bin/pavcl','pavcl'],

    '-auto -aex -heu -cmp -nbr -nor -nos -eng -nob {}',

    qr/Number of files infected[ .]*: 0+(?!\d)/,

    qr/Number of files infected[ .]*: 0*[1-9]/,

    qr/Found virus :\s*(\S+)/ ],

  ['NAI McAfee AntiVirus (uvscan)', 'uvscan',

    '--secure -rv --mime --summary --noboot --mailbox --program --timeout 180 - {}', [0], [13],

    qr/(?x) Found (?:

        \ the\ (.+)\ (?:virus|trojan)  |

        \ (?:virus|trojan)\ or\ variant\ ([^ ]+)  |

        :\ (.+)\ NOT\ a\ virus)/,

  ],

  ['VirusBuster', ['vbuster', 'vbengcl'],

    "{} -ss -i '*' -log=$MYHOME/vbuster.log", [0], [1],

    qr/: '(.*)' - Virus/ ],

  ['CyberSoft VFind', 'vfind',

    '--vexit {}/*', [0], [23], qr/##==>>>> VIRUS ID: CVDL (.+)/,

  ],

  ['avast! Antivirus', ['/usr/bin/avastcmd','avastcmd'],

    '-a -i -n -t=A {}', [0], [1], qr/\binfected by:\s+([^ \t\n\[\]]+)/ ],

  ['Ikarus AntiVirus for Linux', 'ikarus',

    '{}', [0], [40], qr/Signature (.+) found/ ],

  ['BitDefender', 'bdc',

    '--arc --mail {}', qr/^Infected files *:0+(?!\d)/,

    qr/^(?:Infected files|Identified viruses|Suspect files) *:0*[1-9]/,

    qr/(?:suspected|infected): (.*)(?:\033|$)/ ],

);

@av_scanners_backup = (

  ['ClamAV-clamscan', 'clamscan',

    "--stdout --no-summary -r --tempdir=$TEMPBASE {}",

    [0], qr/:.*\sFOUND$/, qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],

  ['FRISK F-Prot Antivirus', ['f-prot','f-prot.sh'],

    '-dumb -ai -archive -packed -server {}', [0,8], [3,6],   # or: [0], [3,6,8],

    qr/(?:Infection:|security risk named) (.+)|\s+contains\s+(.+)$/ ],

  ['Trend Micro FileScanner', ['/etc/iscan/vscan','vscan'],

    '-za -a {}', [0], qr/Found virus/, qr/Found virus (.+) in/ ],

  ['drweb - DrWeb Antivirus',  # security LHA hole in Dr.Web 4.33 and earlier

    ['/usr/local/drweb/drweb', '/opt/drweb/drweb', 'drweb'],

    '-path={} -al -go -ot -cn -upn -ok-',

    [0,32], [1,9,33], qr' infected (?:with|by)(?: virus)? (.*)$'],

   ['Kaspersky Antivirus v5.5',

     ['/opt/kav/5.5/kav4unix/bin/kavscanner',

      '/opt/kav/5.5/kav4mailservers/bin/kavscanner','kavscanner'],

     '-i0 -xn -xp -mn -R -ePASBME {}/*', [0,10,15], [5,20,21,25],

     qr/(?:INFECTED|WARNING|SUSPICION|SUSPICIOUS) (.*)/ ,

   ],

);

1;  # insure a defined return

$interface_policy{'SOCK'} = 'AM.PDP';

$policy_bank{'AM.PDP'} = {protocol=>'AM.PDP', auth_required_release => 0 };

$unix_socketname='/var/amavis/amavisd.sock';

```

/etc/postfix/main.cf

```

queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

mail_owner = postfix

myhostname = baal.gotdns.org

mydomain = baal.gotdns.org

myorigin = $mydomain

inet_interfaces = all

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

unknown_local_recipient_reject_code = 550

mynetworks_style = subnet

mynetworks = 192.168.2.0/24, 127.0.0.0/8

relayhost = [smtp.netcologne.de]

recipient_delimiter = +

 

mailbox_transport = cyrus

  

local_destination_concurrency_limit = 2

default_destination_concurrency_limit = 10

debug_peer_level = 1

debugger_command =

    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

    xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail

newaliases_path = /usr/bin/newaliases

mailq_path = /usr/bin/mailq

setgid_group = postdrop

html_directory = /usr/share/doc/postfix-2.3.7/html

manpage_directory = /usr/share/man

sample_directory = /etc/postfix

readme_directory = /usr/share/doc/postfix-2.3.7/readme

smtpd_sasl_auth_enable = yes

smtpd_sasl2_auth_enable = yes

smtpd_sasl_security_options = noanonymous

broken_sasl_auth_clients = yes

message_size_limit = 50000000

smtpd_sasl_local_domain = $myhostname

smtpd_sasl_security_options = noanonymous

smtpd_recipient_restrictions =

   permit_sasl_authenticated,

   permit_mynetworks,

   reject_unauth_destination,

   check_sender_access hash:/etc/postfix/sender_access

smtp_use_tls = yes

smtp_tls_note_starttls_offer = yes

smtpd_use_tls = yes

smtpd_tls_key_file = /etc/ssl/postfix/server.key

smtpd_tls_cert_file = /etc/ssl/postfix/server.crt

smtpd_tls_loglevel = 0

smtpd_tls_received_header = yes

smtpd_tls_session_cache_timeout = 3600s

tls_random_source = dev:/dev/urandom

biff = no

empty_address_recipient = MAILER-DAEMON

queue_minfree = 120000000

content_filter = smtp-amavis:[127.0.0.1]:10024

```

/etc/postfix/master.cf

```

smtp      inet  n       -       n       -       -       smtpd -v

pickup    fifo  n       -       n       60      1       pickup

cleanup   unix  n       -       n       -       0       cleanup

qmgr      fifo  n       -       n       300     1       qmgr

tlsmgr    unix  -       -       n       1000?   1       tlsmgr

rewrite   unix  -       -       n       -       -       trivial-rewrite

bounce    unix  -       -       n       -       0       bounce

defer     unix  -       -       n       -       0       bounce

trace     unix  -       -       n       -       0       bounce

verify    unix  -       -       n       -       1       verify

flush     unix  n       -       n       1000?   0       flush

proxymap  unix  -       -       n       -       -       proxymap

smtp      unix  -       -       n       -       -       smtp

relay     unix  -       -       n       -       -       smtp

   -o fallback_relay=

showq     unix  n       -       n       -       -       showq

error     unix  -       -       n       -       -       error

discard   unix  -       -       n       -       -       discard

local     unix  -       n       n       -       -       local

virtual   unix  -       n       n       -       -       virtual

lmtp      unix  -       -       n       -       -       lmtp

anvil     unix  -       -       n       -       1       anvil

scache     unix   -   -   n   -   1   scache

maildrop  unix  -       n       n       -       -       pipe

  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

old-cyrus unix  -       n       n       -       -       pipe

  flags=R user=cyrus argv=/usr/lib/cyrus/deliver -e -m ${extension} ${user}

cyrus     unix  -       n       n       -       -       pipe

  flags=hu user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -m ${extension} ${user}

virt-cyrus     unix  -       n       n       -       -       pipe

  flags=hu user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -m ${recipient} ${user}

uucp      unix  -       n       n       -       -       pipe

  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

ifmail    unix  -       n       n       -       -       pipe

  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp     unix  -       n       n       -       -       pipe

  flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

smtp-amavis     unix -        -       n     -       3  smtp

  -o smtp_data_done_timeout=1200

  -o smtp_send_xforward_command=yes

     

127.0.0.1:10025 inet n        -       n     -       -  smtpd

  -o smtpd_recipient_restrictions=permit_mynetworks,reject

  -o content_filter=

  -o local_recipient_maps=

  -o relay_recipient_maps=

  -o smtpd_restriction_classes=

  -o smtpd_client_restrictions=

  -o smtpd_helo_restrictions=

  -o smtpd_sender_restrictions=

  -o mynetworks=127.0.0.0/8

  -o strict_rfc821_envelopes=yes

  -o smtpd_error_sleep_time=0

  -o smtpd_soft_error_limit=1001

  -o smtpd_hard_error_limit=1000

```

thx, strowi

----------

## steveb

I think it is SA deleting them and not Amavis. Can you post your SA configuration? Or maybe look into SA and check if you delete spam mails there?

----------

## Strowi

mhh the only things i added to spamassassin were RulesDuJour,razor and ixspam.cf (a pretty good addon from the iX-magazine) the rest should still be on default-settings. I will check those settings tomorrow, as it is already 0:10am and i just discovered a Harrison Ford movie is being aired  :Wink: 

I thought 'someone' might have tagged the mails, and postfix was misconfigured to discard those because the log came from postfix...

Thx for your input!

----------

## Strowi

looks like rulesdujour was at least part of the problem, since i unmerged it not a single message got discarded

----------

## magic919

I'm inclined to say it was amavisd that discarded them but it was polite enough to tell Postfix and that's why it ended up in the logs.

----------

## Strowi

But the weird thing is, that there was really no sign in the amavis-log. Guess i will have to check the config file again for dsn/cutoff -stuff.

----------

## magic919

Much as I hear what you are saying here's the key bit.

```

Apr  6 12:34:04 Baal postfix/smtp[14106]

```

Note the postfix/SMTP.  That's as in Postfix using SMTP, not SMTPD.  It uses SMTP when it sends and SMTPD to receive.

----------

