Junk Dir not working..

Discussion in 'Installation/Configuration' started by RobMorin, Feb 17, 2014.

  1. RobMorin

    RobMorin New Member

    Hello all I have searched through the forums and cannot find out why my Move Spam to Junk Dir is not working.

    I read quite a few posts, but nothing seems to work for me...
    I am running Version On Ubuntu with Dovecot in a multi server setup.

    The check box under the tab "mail filter" is checked. The .sieve file gets updated properly as far as i can see.

    require ["fileinto", "regex", "date", "relational", "vacation"];
    # Move spam to spam folder
    if header :contains "X-Spam-Flag" "YES" {
    fileinto "Junk";
    # Stop here so that we do not reply on spams

    I made sure as per one post that ....

    protocol lda {
    # Space separated list of plugins to load (default is global mail_plugins).
    mail_plugins = $mail_plugins sieve

    in the file /etc/dovecot/conf.d/15-lda.conf is proper and restarted dovecot.

    Any ideas?

    Thanks to all....
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    And the emails that dnt get filtered out contain a X-Spam-Flag YES header?
  3. RobMorin

    RobMorin New Member

    Ah, dam you know what, i assumed this, i did not check headers, let me check... I will re post in a bit...

  4. RobMorin

    RobMorin New Member

    Ok, after a few more tests, i discovered something... maybe I am not understanding something.... if i raise the "SPAM kill level"(in the Normal policy) to 999.00 and send the test SPAM string i see this in the logs...

    (IPs & emails have been changed to protect the innocent :) )

    Feb 17 15:59:28 mail2 amavis[6597]: (06597-02) Passed SPAMMY, [] [] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: OTxIJJWtItRu, Hits: 998.002, size: 9029, queued_as: 09D2B5225B6, [email protected],[email protected], 579 ms
    Feb 17 15:59:28 mail2 postfix/smtp[6849]: 5666B520F3B: to=<[email protected]>, relay=[]:10024, delay=0.8, delays=0.21/0/0.01/0.58, dsn=2.0.0, status=sent (250 2.0.0 from MTA([]:10025): 250 2.0.0 Ok: queued as 09D2B5225B6)
    Feb 17 15:59:28 mail2 postfix/qmgr[23596]: 5666B520F3B: removed
    Feb 17 15:59:28 mail2 dovecot: lda([email protected]): sieve: msgid=<[email protected]>: stored mail into mailbox 'Junk'
    Feb 17 15:59:28 mail2 postfix/pipe[6875]: 09D2B5225B6: to=<[email protected]>, relay=dovecot, delay=0.13, delays=0.04/0.01/0/0.08, dsn=2.0.0, status=sent (delivered via dovecot service)

    If i leave the Kill Spam at my normal level of 6.5 i see this in the logs after sending the Spam string in an email...

    Feb 17 16:01:28 mail2 amavis[6598]: (06598-03) Blocked SPAM, [] [] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: Jn+yae0E6HMe, Hits: 998.002, size: 10066, [email protected],[email protected], 330 ms
    Feb 17 16:01:28 mail2 postfix/smtp[6991]: 644CB520F3B: to=<[email protected]>, relay=[]:10024, delay=0.63, delays=0.28/0.02/0/0.33, dsn=2.7.0, status=sent (250 2.7.0 Ok, discarded, id=06598-03 - SPAM)
    Feb 17 16:01:28 mail2 postfix/qmgr[23596]: 644CB520F3B: removed

    so when its a high spam score it just deletes it as oppose to a spammy score then sends to Junk folder...

    So then i guess its working ok... or do i need to adjust a spammy score?

    Thanks for you prompt reply...
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Its working ok, amavisd works like this:

    The email gets assigned a spam score, depending on the result of the spamassassin tests. Then you have 3 levels:

    spam tag level: If the score is above this level, amavis writes infos about the applied tests in the mail header.

    spam tag2 level. If the score exceeds this level, the email is marked with

    X-Spam-Flag YES

    in the mail header and optionally the subject is rewritten.

    spam kill level: if this level is exceeded, the email gets deleted right away.
  6. RobMorin

    RobMorin New Member

    Thanks Till, I think its working now.... i raised my score from 6.5 to 10.d to get the stuff that might not be spam and it's going into the Junk folder now...

    Thanks buddy!

Share This Page