question about sieve "discard"

Goetz Babin-Ebell goetz at
Wed Apr 27 15:37:55 EDT 2005

Andreas Hasenack wrote:
> A friend of mine had these rules (cyrus-imapd-2.2.12):
> ------8<-------
> if ....
> elsif ....
> elsif header :contains "From" "someone at somewhere" {
> 	discard;
> }
> if ...
> (script continues)
> ------8<-------
> Note how the if/elsif structure is broken and a new if statement begins
> later on. That was a copy&paste error (the second "if" should have been
> "elsif" to continue the case-like structure).
> The interesting thing is that a message from "someone at somewhere"
> survived the discard. Is that because there should be a "stop;" after
> the discard action? It matched some other rule down the road in the
> second "if" structure.

from RFC 3028:
4.5.     Action discard

    Syntax:   discard

    Discard is used to silently throw away the message.  It does so by
    simply canceling the implicit keep.  If discard is used with other
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    actions, the other actions still happen.  Discard is compatible with
    all other actions.  (For instance fileinto+discard is equivalent to

Sieve processes the script, doing the actions set there.
If at the end of the script the message was not filed into any mailbox,
it is silently filed into the primary mailbox.
And only this implicit last step (file it in the primary mailbox)
is removed by the discard command.

It does NOT have an implicit stop.



DMCA: The greed of the few outweighs the freedom of the many
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3185 bytes
Desc: S/MIME Cryptographic Signature
Url :

More information about the Info-cyrus mailing list