Centos 7 amavis spam blacklist/whitlist not working

Discussion in 'Installation/Configuration' started by kephra, Jul 28, 2015.

  1. kephra

    kephra Member

    I have noticed that this function does not work on my ispconfig Centos 7 install
    Checked the following:
    Tested by blacklisting an external email address, but emails are delivered, and not marked as spam.
    Checked amavisd.conf
    dbispconfig correctly configured with ispconfig dbispconfig password.
    @lookup_sql_dsn =
    ( ['DBI:mysql:database=dbispconfig;host=127.0.0.1;port=3306', 'ispconfig', 'XXXX-password correct''] );​

    two sql select statements configured.
    $sql_select_policy =
    'SELECT *,spamfilter_users.id'.
    ' FROM spamfilter_users LEFT JOIN spamfilter_policy ON spamfilter_users.policy_id=spamfilter_policy.id'.
    ' WHERE spamfilter_users.email IN (%k) ORDER BY spamfilter_users.priority DESC';
    $sql_select_white_black_list = 'SELECT wb FROM spamfilter_wblist'.
    ' WHERE (spamfilter_wblist.rid=?) AND (spamfilter_wblist.email IN (%k))' .
    ' ORDER BY spamfilter_wblist.priority DESC';​

    /var/spool/amavisd/db contains
    -rw-r----- 1 amavis amavis 262144 Jul 28 09:20 __db.001
    -rw-r----- 1 amavis amavis 32768 Jul 28 09:20 __db.002
    -rw-r----- 1 amavis amavis 49152 Jul 28 09:20 __db.003
    -rw-r----- 1 amavis amavis 12288 Jul 28 07:30 nanny.db
    -rw-r----- 1 amavis amavis 12288 Jul 28 07:30 snmp.db​

    On amavsid startup, amavisd logs:
    Jul 28 07:30:12 earth amavis[4278]: Net::Server: Group Not Defined. Defaulting to EGID '995 995'
    Jul 28 07:30:12 earth amavis[4278]: Net::Server: User Not Defined. Defaulting to EUID '996'
    Jul 28 07:30:12 earth amavis[4278]: Module Amavis::Conf 2.404
    Jul 28 07:30:12 earth amavis[4278]: Module Archive::Zip 1.30
    Jul 28 07:30:12 earth amavis[4278]: Module BerkeleyDB 0.51
    Jul 28 07:30:12 earth amavis[4278]: Module Compress::Raw::Zlib 2.061
    Jul 28 07:30:12 earth amavis[4278]: Module Compress::Zlib 2.061
    Jul 28 07:30:12 earth amavis[4278]: Module Crypt::OpenSSL::RSA 0.28
    Jul 28 07:30:12 earth amavis[4278]: Module DBD::mysql 4.023
    Jul 28 07:30:12 earth amavis[4278]: Module DBI 1.627
    Jul 28 07:30:12 earth amavis[4278]: Module DB_File 1.83
    Jul 28 07:30:12 earth amavis[4278]: Module Digest::MD5 2.52
    Jul 28 07:30:12 earth amavis[4278]: Module Digest::SHA 5.85
    Jul 28 07:30:12 earth amavis[4278]: Module Encode 2.51
    Jul 28 07:30:12 earth amavis[4278]: Module File::Temp 0.2301
    Jul 28 07:30:12 earth amavis[4278]: Module IO::Socket::INET6 2.69
    Jul 28 07:30:12 earth amavis[4278]: Module IO::Socket::IP 0.21
    Jul 28 07:30:12 earth amavis[4278]: Module MIME::Entity 5.505
    Jul 28 07:30:12 earth amavis[4278]: Module MIME::parser 5.505
    Jul 28 07:30:12 earth amavis[4278]: Module MIME::Tools 5.505
    Jul 28 07:30:12 earth amavis[4278]: Module Mail::DKIM::Verifier 0.39
    Jul 28 07:30:12 earth amavis[4278]: Module Mail::Header 2.12
    Jul 28 07:30:12 earth amavis[4278]: Module Mail::Internet 2.12
    Jul 28 07:30:12 earth amavis[4278]: Module Mail::SPF v2.008
    Jul 28 07:30:12 earth amavis[4278]: Module Mail::SpamAssassin 3.004000
    Jul 28 07:30:12 earth amavis[4278]: Module Net::DNS 0.72
    Jul 28 07:30:12 earth amavis[4278]: Module Net::LibIDN 0.12
    Jul 28 07:30:12 earth amavis[4278]: Module Net::Server 2.007
    Jul 28 07:30:12 earth amavis[4278]: Module NetAddr::IP 4.069
    Jul 28 07:30:12 earth amavis[4278]: Module Razor2::Client::Version 2.84
    Jul 28 07:30:12 earth amavis[4278]: Module Scalar::Util 1.27
    Jul 28 07:30:12 earth amavis[4278]: Module Socket 2.010
    Jul 28 07:30:12 earth amavis[4278]: Module Socket6 0.23
    Jul 28 07:30:12 earth amavis[4278]: Module Time::HiRes 1.9725
    Jul 28 07:30:12 earth amavis[4278]: Module URI 1.60
    Jul 28 07:30:12 earth amavis[4278]: Module Unix::Syslog 1.1
    Jul 28 07:30:12 earth amavis[4278]: Amavis::ZMQ code NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: Amavis::DB code loaded
    Jul 28 07:30:12 earth amavis[4278]: SQL base code loaded
    Jul 28 07:30:12 earth amavis[4278]: SQL::Log code NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: SQL::Quarantine NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: Lookup::SQL code loaded
    Jul 28 07:30:12 earth amavis[4278]: Lookup::LDAP code NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: AM.PDP-in proto code loaded
    Jul 28 07:30:12 earth amavis[4278]: SMTP-in proto code loaded
    Jul 28 07:30:12 earth amavis[4278]: Courier proto code NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: SMTP-out proto code loaded
    Jul 28 07:30:12 earth amavis[4278]: Pipe-out proto code NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: BSMTP-out proto code NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: Local-out proto code loaded
    Jul 28 07:30:12 earth amavis[4278]: OS_Fingerprint code NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: ANTI-VIRUS code loaded
    Jul 28 07:30:12 earth amavis[4278]: ANTI-SPAM code loaded
    Jul 28 07:30:12 earth amavis[4278]: ANTI-SPAM-EXT code NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: ANTI-SPAM-C code NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: ANTI-SPAM-SA code loaded
    Jul 28 07:30:12 earth amavis[4278]: Unpackers code loaded
    Jul 28 07:30:12 earth amavis[4278]: DKIM code NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: Tools code NOT loaded
    Jul 28 07:30:12 earth amavis[4278]: Found $file at /usr/bin/file
    Jul 28 07:30:12 earth amavis[4278]: Found $altermime at /usr/bin/altermime
    Jul 28 07:30:12 earth amavis[4278]: Internal decoder for .mail
    Jul 28 07:30:12 earth amavis[4278]: Internal decoder for .asc
    Jul 28 07:30:12 earth amavis[4278]: Internal decoder for .uue
    Jul 28 07:30:12 earth amavis[4278]: Internal decoder for .hqx
    Jul 28 07:30:12 earth amavis[4278]: Internal decoder for .ync
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .F at /usr/bin/unfreeze
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .Z at /usr/bin/gzip -d
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .gz at /usr/bin/gzip -d
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .bz2 at /usr/bin/bzip2 -d
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .lzo at /usr/bin/lzop -d
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .rpm at /usr/bin/rpm2cpio
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .cpio at /usr/bin/pax
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .tar at /usr/bin/pax
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .deb at /usr/bin/ar
    Jul 28 07:30:12 earth amavis[4278]: Internal decoder for .zip
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .7z at /usr/bin/7za
    Jul 28 07:30:12 earth amavis[4278]: No ext program for .rar, tried: rar, unrar
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .arj at /usr/bin/arj
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .arc at /usr/bin/nomarch
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .zoo at /usr/bin/unzoo
    Jul 28 07:30:12 earth amavis[4278]: No ext program for .lha, tried: lha
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .cab at /usr/bin/cabextract
    Jul 28 07:30:12 earth amavis[4278]: No ext program for .tnef, tried: tnef
    Jul 28 07:30:12 earth amavis[4278]: Internal decoder for .tnef
    Jul 28 07:30:12 earth amavis[4278]: Found decoder for .exe at /usr/bin/arj
    Jul 28 07:30:12 earth amavis[4278]: No decoder for .lha
    Jul 28 07:30:12 earth amavis[4278]: No decoder for .rar
    Jul 28 07:30:12 earth amavis[4278]: Using primary internal av scanner code for ClamAV-clamd
    Jul 28 07:30:12 earth amavis[4278]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
    Jul 28 07:30:12 earth amavis[4278]: Deleting db files __db.001,__db.002,__db.003,snmp.db,nanny.db in /var/spool/amavisd/db
    Jul 28 07:30:12 earth amavis[4278]: Creating db in /var/spool/amavisd/db/; BerkeleyDB 0.51, libdb 5.3​

    The dbispconfig table entries seem correct, at least they agree with the entries from the ispconfig 3 interface.
    Is there some other configuration item I should check?
    Thanks,
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Maybe amavisd is not reading the correct amavisd.conf, o centos there are sometimes problems with the conf file location, please check if there is a /etc/amavisd.conf and /etc/amavisd/amavisd.conf and if both exist, then one should be a symlink to the other.
     
  3. kephra

    kephra Member

    I only had /etc/amavisd/amavisd.conf, so I linked /etc/amavisd.conf to /etc/amavisd/amavisd.conf restarted amavisd and retested with the same result. That was a good idea though.

    K
     
  4. kephra

    kephra Member

    Any other ideas? Anyone?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    you can try to set the log level to a higher value (e.g. 5 if I remember correctly) in amavisd.conf and then restart amavisd. amavisd should show then in the log in detail how it queries the database.
     

Share This Page