Can't discard spam messages on arrival using Sieve filters
-
@d19dotca Just got around to looking into this. This doesn't work because the mail server processes spam messages using dovecot's
sieve_before
flag - https://doc.dovecot.org/settings/pigeonhole/#plugin-sieve-setting-sieve-before . You can check the/app/dovecot-config/sieve_before/spam-move.sieve
script in the mail container which is moving X-Spam-Flag into the Spam folder. Because the filter below is run before user messages, your filters don't work. This also makes it easy for the end user to not worry about processing spam messages when writing filters, so I think the default behavior is good.require ["fileinto","mailbox"]; if header :contains "X-Spam-Flag" "YES" { fileinto "Spam"; stop; }
For the original use case of discarding all spam for forwarding mailboxes, this is the default behavior in next release.
-
@girish said in Can't discard spam messages on arrival using Sieve filters:
so I think the default behavior is good.
As a default I think so too, but whilst the spam protection in Cloudron is reliable, sometimes the end user wants / needs to be able to filter spam messages directly It would therefore be good to have a simple way of filtering mails to discard spam selectively rather than just having all SPAM go to the SPAM folder. Mails with a SPAMASSASSIN score of over 20, for example, do not need to be saved anywhere, but those with a score of 7 or 8 could in theory be false positives so would warrant 'quarantining' rather than discarding altogether. The same applies to certain sender addresses and subjects.
This does not need to be something defined in webmail clients per domain, but could be a server-wide setting similar to the custom spamassassin rules.
-
@girish said in Can't discard spam messages on arrival using Sieve filters:
For the original use case of discarding all spam for forwarding mailboxes, this is the default behavior in next release.
Do you mind just expanding on this a bit more? What is a "forwarding mailbox" in your terms? Are you referring to the other feature request I had about mailing lists having an option to not forward messages identified as spam? If so, that's great! But now I will have to go back to the mailing list functionality I had moved away from a couple weeks ago, haha, but that's all good. If I've misunderstood what you mean by "forwarding mailbox" though, please clarify.
-
Any update on this? Ideally it would be nice to be able to define a custom spam assassin rule to instantly discard mails with certain criteria. I see persistent SPAM in the event log with easily identifiable criteria I would like to discard before it hits a mailbox but at the moment all I can do is give it a score of 100 so it is always marked as SPAM.
Whilst we can prevent mailservers with specific IPs or ranges from delivering mails via the firwall, this does not work for hostnames. That would be another way of stopping persistent spamming domains.
-
-