# You have to 'require' certain features before you can use them in rules. require ["fileinto","regex","copy"]; # fileinto use for nested folders: use periods instead of /s # e.g. use fileinto "Backup.Client.Server1" instead of "Backup/Client/Server1" ### Discard, doesn't even make it to trash folder - Multiple ### if anyof ( header :contains "To" "user1@example.com", header :contains "To" "user2@example.com", header :contains "To" "user3@example.com", header :contains "From" "user4@example.com", header :contains "From" "@exampletwo.com" ) { discard; stop; } ### Move to Trash - Multiple ### if anyof ( header :contains "Subject" "Viagra", header :contains "From" "Annoying Spammer" ) { fileinto "Deleted Messages"; stop; } # Move to Trash - Single # # All of these conditions must be met for the move to be made. if allof ( header :contains "Subject" "Example Subject", header :contains ["Message","Content"] "mysqldump: Got error: 1044: Access denied for blah") { fileinto "Deleted Messages"; } ### Move to Folder - Multiple ### # Note that the folder "Solicited Bulk Email" must exist, or feel free to customize. if anyof ( header :contains "From" "newsletter1@example1.com", header :contains "From" "newsletter2@example2.com", header :contains "From" "newsletter3@example3.com" ) { fileinto "Solicited Bulk Email"; stop; } ### Forward to Someone - Multiple ### if anyof ( header :contains "To" "company1@example.com", header :contains "To" "company2@example.com", header :contains "To" "company3@example.com", header :contains "To" "company4@example.com" ) { redirect :copy "user@exampletoo.com"; } # Example of exact format Lion used. Yes, it's kind of an odd rule. #if allof (header :contains "To" "company@mydomain.com", not header :contains "From" "@companydomain.com") #{ # discard; # stop; #}