test-foreverypart-complex-ref.siv 830 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
require "foreverypart";
require "reject";
require "subaddress";
require "fileinto";
require "imap4flags";

#SCRIPTNAME: Script part 0
# Sieve filter
# Declare the extensions used by this script.
10

11
# Messages bigger than 100K will be rejected with an error message
12

13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
foreverypart :name "foo" {
    if size :over 100K
    {
        reject text:
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.
.
;

    } elsif address :all :is [ "From", "To" ] "mailinglist@blafasel.invalid"
    {
        fileinto "INBOX.mailinglist";
    } elsif anyof (not address :all :contains [ "To", "Cc", "Bcc" ] "me@blafasel.invalid"
    , header :matches "Subject" [ "*money*", "*Viagra*" ]
    )
    {
        fileinto "INBOX.spam";
        break;
    } else {
        keep;
    } 
}
Laurent Montel's avatar
Laurent Montel committed
36