Op 2-9-2026 om 16:00 schreef Antonio Oliveira via dovecot:
Hello,
You can try to add "stop;" after "discard;", so that rule processing stops after the discard and doesn't trickle down to the other rule.
Yes, this will help. Why? The discard action command only cancels the implicit keep; nothing else. It means that if and only if no other explicit action delivers or preserves (keeps!) the message somehow, it is discarded. So, if subsequently redirect is triggered, the message is redirected, thereby making the discard action ineffective. Stopping the script right after discard will make sure no other actions can be triggered, thereby making sure the message is discarded (provided no earlier actions already triggered some sort of delivery either). Without discard or any other action command that cancels the implicit keep (such as redirect, fileinto, and ... keep), the default action is to "keep" the message, e.g. file it to INBOX.
Regards,
Stephan.
On 9/2/2026 1:05 PM, Jorge Bastos via dovecot wrote:
Hi guys,
Small help with a sieve script, I have the script below in a useraccount, in this exact order. The redirect works, but the discard doesn't. A message that comes from the domain "clubefashing.com" or "nutribody.pt", is always redirected.
Any idea what is wrong here?
# rule:[blocks] if anyof (header :contains "from" "clubefashion.com", header :contains "from" "nutribody.pt") { discard; } # rule:[redir] if true { redirect "jorge@decimal.pt"; }
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org