SPAM over assigned policy's kill level not deleted automatically

Discussion in 'Installation/Configuration' started by cbj4074, Jan 9, 2012.

  1. cbj4074

    cbj4074 HowtoForge Supporter

    I created a new "Spamfilter Policy" under Email -> Policy, but it seems as though the policy is not being applied to incoming mail.

    My understanding is that if the "SPAM kill level" is set to 15, then messages with a SPAM score >= 15 will be discarded.

    There seems to be conflicting information regarding the following directive in /etc/amavis/conf.d/50-user:

    $final_spam_destiny = D_DISCARD;
    Some say that this directive must be enabled in this specific configuration file for automatic SPAM deletion to occur, while others (e.g., Till) say that this directive is irrelevant, as ISPConfig overrides this value on a per-policy-assignment basis.

    Anyway, the line in question is un-commented in my amavis configuration.

    However, messages with an X-Spam-Score header well over the kill level are not deleted automatically. Here are the headers from one such email message:

    X-Virus-Scanned: Debian amavisd-new at
    X-Spam-Flag: YES
    X-Spam-Score: 27.428
    X-Spam-Level: ***************************
    X-Spam-Status: Yes, score=27.428 tagged_above=1 required=4.5
    tests=[BAYES_99=3.5, DATE_IN_FUTURE_24_48=2.048,
    URIBL_SBL=1.623, URIBL_WS_SURBL=1.608] autolearn=spam
    Screen captures of the Spampolicy Filter settings, and of the individual mailbox's Spamfilter setting are attached.

    The Spamfilter setting for the domain is set to "Normal", but my understanding is that the Spamfilter setting for the specific mailbox should override the domain-level setting.

    Am I missing something?

    Attached Files:

  2. till

    till Super Moderator

    As you can see in the mail header, a policy where spam tag2 Level = 4.5 is applied to this email:

    The policy you posted has score 5.0, so this is not the policy that got applied. Please check your policys to find the one with tag level 4.5.

    Beside that, please go To spamfilter > User/Domain and post the priority of the domain rule and the mailbox rule.
  3. cbj4074

    cbj4074 HowtoForge Supporter

    Ah, thank you for pointing-out that the filter being applied has 4.5 for the tag2 level. It is the "Normal" filter that is being applied.

    In Email -> Spamfilter -> User / Domain, the "Normal" filter has a priority of 5, and the "Auto-Delete Really Spammy Spam" filter has a priority of 10.

    So, this all makes sense. The part I was missing is the Priority.

    I have lowered the priority for the "Auto-Delete Really Spammy Spam" filter to 1 and expect that this will correct the issue.

    My only question: is there any means by which to avoid having to double-check (and potentially change) the Priority value for every user to whom a new policy is applied?

    To be clear, I would prefer that user-level policies always take precedence over domain-level policies.
    Last edited: Jan 9, 2012
  4. till

    till Super Moderator

    The last time I tested it on my servers, amavis picked up the highest priority first and not the lowest as on your system now, so the way ispconfig assigned the priorities worked here. I will test that again, maybe its a config option or this has been changed in a amavis release.

    Which amavis version dp you have installed.
  5. cbj4074

    cbj4074 HowtoForge Supporter

    I'm using amavisd-new-2.6.4.
  6. till

    till Super Moderator

    Checked it on my servers here and amavis selects the correct policy (mailbox has precedence before domain rule). I verified this also in the amavis config file where the order is set correctly in the sql querys:

    $sql_select_policy =
       'SELECT *,'.
       ' FROM spamfilter_users LEFT JOIN spamfilter_policy ON'.
       ' WHERE IN (%k) ORDER BY spamfilter_users.priority DESC';
    $sql_select_white_black_list = 'SELECT wb FROM spamfilter_wblist'.
        ' WHERE (spamfilter_wblist.rid=?) AND ( IN (%k))' .
        ' ORDER BY spamfilter_wblist.priority DESC';
    Maybe you use a modified amavis configuration file on your system and not the one that is delivered with ISPconfig?
  7. cbj4074

    cbj4074 HowtoForge Supporter

    I have not modified the amavis configuration; the MySQL queries in my file look just like yours.

    I'll do some additional testing and report back when I figure out exactly what's going on. Thanks for pointing me in the right direction!

Share This Page