What is the format of a Sieve Script?
There are 4 basic parts to a Sieve script:
1. Requirements
This documents what Sieve extensions are required for the script.
2. Condition
What you are looking for in the message.
3. Action
What to do with the message.
4. Documentation
This doesn't get executed, it's a note in plain language marked with a hash symbol (#) at the beginning and a CRLF at the end to remind you what the script does
Example:
# Reject large messages
#
require ['fileinto', 'reject'];
# Messages bigger than 100K will be rejected with an error message
#
if size :over 100K
{
reject 'I'm sorry, I do not accept mail over 100kb in size. Please upload larger files to a server and send me a link. Thanks.';
}
In the example above, the different parts break into:
# Reject large messages
#
This is documentation.
require ['fileinto', 'reject'];
This is the requirements
# Messages bigger than 100K will be rejected with an error message
#
More documentation
if size :over 100K
This is the condition
{
reject 'I'm sorry, I do not accept mail over 100kb in size. Please upload larger files to a server and send me a link. Thanks.';
}
This is the action