The Sieve class interprets the Sieve language, which processes incoming messages to determine their fate.
The class requires fairly specific usage: An object is created, the message sender is set using setSender(), the recipients with addRecipient() and the message itself with setMessage().
Once addRecipient() has been called, evaluate() may be, and can give results. It's unlikely (but possible) that results may be available before setMessage() has been called.
Sieve extensions are implemented in SieveProduction and Sieve. The list is in SieveProduction::supportedExtensions();
Constructs an empty message Sieve.
Starts executing all the actions(), notifying handler when done.
Returns a list of all actions this Sieve has decided that address need performed. It returns a null pointer if address has never been passed to addRecipient(), and a pointer to a (possibly empty) list if address has been added.
Records that action is to be performed if evaluation of the current user's sieve script does not fail.
At some point, this may/will also do something of a more general nature if there is no current recipient. Global sieve scripts, etc.
Looks up address in the aliases table, finds the related sieve script and other needed information so that delivery to address can be evaluated. Calls user when the information is available.
If address is not a registered alias, Sieve will refuse mail to it.
Records that address is one of the recipients for this message, and that destination is where the mailbox should be stored by default. Sieve will use script as script. If user is non-null, Sieve will check that fileinto statement only files mail into mailboxes owned by user.
Records that the message should be forwarded via the smarthost to address.
Returns true if the Sieve has finished evaluation (although not execution), and false if there's more to do before evaluation is complete. injected() is this function's bigger sister.
Returns an error message if delivery to address caused a run-time error, and an empty string if all is in order or address is not a valid address.
Returns an error message if delivery to any address caused a run-time error, and an empty string in all other cases.
Runs any sieve scripts currently available, sees what results can be found, and returns when it can't do anything more. If done() is true after evaluate(), evaluate() need not be called again.
Used only for database chores - selecting the scripts mostly. Anything else?
Returns true if delivery to address failed or will fail, and false if it succeeded or if evaluation is not yet complete.
Returns a list of the Address objects to which this message should be forwarded.
The return value is never 0.
Returns what setForwardingDate() recorded, or null if setForwardingDate() has not been called.
Returns true if every injector created by this Sieve has finished its work. When ready() and done() and injected(), the Sieve is completely done.
Returns true if address is known to be a local address, and false if address is not known, if the Sieve isn't ready() or if address is remote.
If the Sieve is ready() and address is not local(), then it must be a remote address.
Returns a list of the Mailbox objects to which the message should be delivered. This won't quite do when we implement the imapflags extension - then, the different mailboxes mailboxes may need different flags.
The return value is never 0.
Returns true if evaluate() may be called, and false if execute() still has work to do.
Returns a pointer to the recipient currently being sieved, or a null pointer if the Sieve engine is not currently working on any particular recipient.
In the future, I think we'll add a way to sieve between MAIL FROM and RCPT TO, so recipient() can realistically return 0.
Returns true if delivery to address should be rejected, and false if it should be accepted, if evaluation is not yet complete or if address is not managed by this sieve.
Returns true if this message has been rejected by (all of its) recipient(s), and false if it has no recipients or has been accepted by at least one.
Returns a pointer to the address set with setSender(), or a null pointer if setSender() has not yet been called.
Records that this message should be delivered to the smarthost sometime later. This applies only to messages delivered to the smarthost, messages injected into local mailboxes are always injected at once.
Records that message is to be used while sieving, and when we received it. All sieve tests that look at e.g. header fields look at message, and message is stored using fileinto/keep and forwarded using redirect. when is only used to record the message's arrival time by fileinto/keep.
Records that the envelope sender is address.
Returns true if an error has happened and should be signalled as a soft error, false if an error has happened and should be signalled as configured by soft-bounce, and an undefined value if no error has occured.
Returns true if delivery to address succeeded, and false if it failed or if evaluation is not yet complete.
Returns a list of all vacation actions. The list may be empty, but it never is a null pointer.
This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.