@girish - this is not possible to do unfortunately in Cloudron it seems, but kindly tell me if I'm doing something wrong here.
The redirect works for filtering out spam, in other words only non-spam messages get through to the endpoint email using a filter like this:
# rule:[Forward non-spam messages]
if allof (not header :contains "x-spam-status" "Yes,")
{
redirect "<externalEmailAddress>";
}
However, all messages marked as spam still save in the mailbox regardless of any filters I set to discard them. In my case, I want the spam messages to be discarded/deleted automatically as there's no sense in them remaining in the "forwarding only" mailbox. It seems maybe there's a priority filter going on elsewhere in Cloudron that's overriding my sieve filter?
Using a filter like this:
# rule:[Discard spam messages on arrival]
if allof (header :contains "x-spam-status" "Yes,")
{
discard;
stop;
}
... will still save the email in the Spam folder. I've tried variations of it too but no-dice. Basically I can't get any filters to work when it's an identified spam message, only filters when it's NOT spam.
Here's a way to reproduce it:
Set this filter in Roundcube:
# rule:[Discard spam messages on arrival]
if allof (header :contains "x-spam-status" "Yes,")
{
discard;
stop;
}
Send a message to the email account using the GTUBE string which SpamAssassin automatically marks with 1000 points, it's basically a test for spam filters: XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
See if the message is really discarded per the sieve filter or if it's still arriving in the Spam folder. In my cases, they still arrive in the Spam folder which seems to be incorrect behaviour.
Edit: I wrote a dedicated bug for this instead: https://forum.cloudron.io/topic/5189/can-t-discard-spam-messages-on-arrival-using-sieve-filters/1