Sieve rule for whitelisting domains after spam processing
Nicolae Iuoras
niuoras at cinergi.net
Wed Aug 10 05:09:25 UTC 2022
Hello,
My mail server has a global Sieve rule defined in sieve_before to file
messages classified as spam by spamassassin into the Spam folder:
require ["regex", "fileinto", "imap4flags"];
if allof (header :regex "X-Spam-Status" "^Yes") {
fileinto "Spam";
}
This works great, except I'd like the ability to whitelist certain senders
or domains whose emails end up in Spam, usually due to a misconfigured SPF
DNS TXT record or something like that. I use Roundcube as my Webmail
client, so the easiest way to whitelist would be to create a rule for each
domain directly in Roundcube using its built-in Sieve integration to move
legitimate messages out of the Spam folder. I already have several rules
set up to flag and sort non-spam messages, and they're working fine. I
therefore tried adding a simple rule to move Spam into the Inbox:
# rule:[Not Spam]
if allof (header :contains "from" "user at good-domain.com")
{
fileinto "INBOX";
}
However, the above rule does not work as I expected. When I receive an
email from good-domain.com that's classified as Spam by spamassassin, the
global rule sends it to the Spam folder and it is not re-filed into the
Inbox. The second rule doesn't seem to do anything. I'm probably doing
something simple wrong, but I can't figure out what (I'm a Sieve newb). Any
suggestions please?
Thanks,
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dovecot.org/pipermail/dovecot/attachments/20220810/7eb04417/attachment-0001.htm>
More information about the dovecot
mailing list