1

Topic: Spam not being transferred to spam folder

==== Required information ====
- iRedMail version: 1.7.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Debian
- Related log if you're reporting an issue:
====

Hi,

I'm experiencing an issue with messages that are being flagged as spam. For some accounts mesagges are being correctly identified as SPAM (name is being changed to ***SPAM***) but for some reason not all of them are being automatically moved from INBOX to SPAM folder. For other accounts (all under the same domain) it works fine. Could you please let me know how this can be fixed.

Thanks in advance.

Regards,

Adilet

2

Re: Spam not being transferred to spam folder

It's hard to say without related log.
Could you please show us the sieve script you used to move spam to SPAM folder? Any related log in /var/log/sieve.log (i believe you have to turn on debug mode in Dovecot to get detailed debug log)?

3

Re: Spam not being transferred to spam folder

Jan 20 10:01:33 lda(account1): Info: sieve: msgid=<52DCF32D.7030406@companieshouse.gov.uk>: stored mail into mailbox 'Junk'
Jan 20 10:01:33 lda(account2): Info: sieve: msgid=<52DCF32D.7030406@companieshouse.gov.uk>: stored mail into mailbox 'Junk'
Jan 20 10:14:37 lda(account3): Info: sieve: msgid=<52DCF761.5000603@rbs.co.uk>: stored mail into mailbox 'Junk'
Jan 20 10:14:40 lda(account4): Info: sieve: msgid=<52DCF761.5000603@rbs.co.uk>: stored mail into mailbox 'INBOX'

From sieve log it's quite clear that it places the same message that was sent to two different accounts into different folders. The one  that is put inside inbox is being identified as spam, according to the header, but still goes to inbox:

X-Spam-Flag: YES
X-Spam-Score: 6.119
X-Spam-Level: ******
X-Spam-Status: Yes, score=6.119 tagged_above=2 required=4 tests=[BAYES_99=3.5,
    RCVD_IN_BRBL_LASTEXT=1.449, RCVD_IN_XBL=0.375, RDNS_NONE=0.793,
    SPF_FAIL=0.001, TO_NO_BRKTS_NORDNS=0.001] autolearn=no

Here is the script:

require ["fileinto"];

# rule:[Move Spam to Junk Folder]
if header :is "X-Spam-Flag" "YES"
{
    fileinto "Junk";
    stop;
}

4

Re: Spam not being transferred to spam folder

*) Do you use global sieve filter to place spam to Junk folder?
*) Do account3 and account4 have personal sieve rules? Dovecot will ignore global sieve rule if personal sieve rules exists.

5

Re: Spam not being transferred to spam folder

Zhang
Thanks I was looking this answer smile
But is there possiblity to have this spam settings always? If some one create first rule in roundcube, rule spam still work?

6

Re: Spam not being transferred to spam folder

Hi @wpolak,

You can use 'sieve_before' or 'sieve_after' as alternatives of "global_sieve", they will be executed with/without per-user sieve rules.

7

Re: Spam not being transferred to spam folder

Thanks Zhang!