Configuration of ISPConfig for Quarantine Email

Discussion in 'Installation/Configuration' started by Edouard Fazenda, Oct 16, 2020.

  1. Edouard Fazenda

    Edouard Fazenda New Member

    Dear Team,

    We have an ISPConfig (3.1) installation with 2 Mail Servers configured with Postfix/Amavis.

    On the Spamfilter Policy defined in ISPConfig we use the "Normal" policy.
    We want to enable the Quarantine to forward spam e-mail to a specific mailbox, We have set the following field :

    • Forward spam to email : spam-mailbox\@ourdomain.com
    But unfortunately all SPAM are not forwarded to out Spam Mailbox.

    Do we have something to enable on the Amavis Configuration ? (/etc/amavis/conf.d/50-user)

    Code:
    use strict;
    @bypass_virus_checks_maps = (
       \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
    
    @bypass_spam_checks_maps = (
       \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
    
    #
    # Database connection settings
    #
    
    @lookup_sql_dsn =
       ( ['DBI:mysql:database=dbispconfig;host=127.0.0.1;port=3306', 'ispconfig', 'XXXXXXXX'] );
    
    # @storage_sql_dsn = @lookup_sql_dsn;  # none, same, or separate database
    #$sql_select_policy = 'SELECT "Y" as local FROM mail_domain WHERE CONCAT("@",domain) IN (%k)';
    # $banned_files_quarantine_method = 'sql';
    # $spam_quarantine_method         = 'sql';
    
    #
    # SQL Select statements
    #
    
    $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)) AND (spamfilter_wblist.active="y")' .
        ' ORDER BY spamfilter_wblist.priority DESC';
    
    #
    # Quarantine settings
    #
    $final_virus_destiny = D_BOUNCE;
    $final_spam_destiny = D_DISCARD;
    $final_banned_destiny = D_BOUNCE;
    $final_bad_header_destiny = D_PASS;
    
    # Default settings, we st this very high to not filter aut emails accidently
    $sa_spam_subject_tag = '***SPAM*** ';
    $sa_tag_level_deflt  = XX;  # add spam info headers if at, or above that level
    $sa_tag2_level_deflt = XX; # add 'spam detected' headers at that level
    $sa_kill_level_deflt = XX; # triggers spam evasive actions
    $sa_dsn_cutoff_level = XX;   # spam level beyond which a DSN is not sent
    
    #
    # Disable spam and virus notifications for the admin user.
    # Can be overridden by the policies in mysql
    #
    
    $virus_admin = undef;
    $spam_admin = undef;
    
    
    #
    # Enable Logging
    #
    
    $DO_SYSLOG = 1;
    $LOGFILE = "/var/log/amavis.log";  # (defaults to empty, no log)
    
    # Set the log_level to 5 for debugging
    $log_level = 0;                # (defaults to 0)
    
    $inet_socket_port = [10024,10026];
    
    # :* = send to incoming Port + 1
    $forward_method = 'smtp:127.0.0.1:*';
    $notify_method = 'smtp:127.0.0.1:*';
    $interface_policy{'10026'} = 'ORIGINATING';
    $policy_bank{'ORIGINATING'} = {
      originating => 1,
      smtpd_discard_ehlo_keywords => ['8BITMIME'],
    };
    
    # IP-Addresses for internal networks => load policy MYNETS
    # - requires -o smtp_send_xforward_command=yes in postfix master.cf
    @mynetworks = qw(0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 [::1] [FE80::]/10 [FEC0::]/10);
    
    # Allow SMTP access from IPs in @inet_acl to amvisd SMTP Port
    @inet_acl = qw( 127.0.0.1 [::1] 192.168.0.0/16 );
    
    # DKIM
    $enable_dkim_verification = 1;
    $enable_dkim_signing = 1; # load DKIM signing code
    $signed_header_fields{'received'} = 0;  # turn off signing of Received
    @dkim_signature_options_bysender_maps = (
    { '.' => { ttl => 21*24*3600, c => 'relaxed/simple' } } );
    
    #------------ Do not modify anything below this line -------------
    1;  # insure a defined return
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    What do you have set for tag levels in the Normal policy?
     
  3. Edouard Fazenda

    Edouard Fazenda New Member

    Dear Jesse,

    We have the following :
    SPAM Tag Level : -999.99
    SPAM tag2 level : 4.00
    SPAM kill level : 6.00
    SPAM dsn cutoff level : 0.00
    SPAM quanrantine cutoff level : 0.00
    SPAM modifies subject : Yes
    SPAM subject tag : Empty
    SPAM subject tag2 : ***SPAM***

    Hope it helps :)

    Thanks for your time and help !
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Set your quarantine level higher.
     
  5. Edouard Fazenda

    Edouard Fazenda New Member

    Dear Jesse,

    Do you mean the SPAM quanrantine cutoff level ?

    Best Regards,
     
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Yes, when it is set to 0, only spam below that level (IE. nothing) will be quarantined.
     

Share This Page