Created
May 31, 2017 16:48
-
-
Save merrilymeredith/9eae16f1770b07e9491ec051d354bf54 to your computer and use it in GitHub Desktop.
Practical sieve examples seem kind of scarce, so...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: ft=sieve | |
require "imap4flags"; | |
require "fileinto"; | |
require "copy"; | |
if address :domain :is ["from", "to", "cc", "bcc"] "frobtech.com" { | |
addflag "frobtech"; | |
if address :all :is "to" "report@frobtech.com" { | |
addflag "\\seen"; | |
fileinto "Trash"; | |
} | |
} | |
if anyof (address :is "to" "meredith@quux.org", | |
header :is "list-id" "<quux.yahoogroups.com>", | |
header :is "list-id" "<quux.googlegroups.com>", | |
address :is "reply-to" "webmaster@quux.org") { | |
addflag "quux"; | |
} | |
if header :is "list-id" "<jobs.perl.org>" { | |
fileinto "Lists.perl-jobs"; | |
} | |
if header :matches "x-original-to" ["root", "postmaster", "mailer-daemon*"] { | |
fileinto "Alias.root"; | |
} | |
if anyof (address :is "from" ["deliverysupport@safeway.com", | |
"service@chewy.com", | |
"billpayer@customercenter.net"], | |
allof (address :is "from" "safeway@email.safeway.com", | |
header :matches "subject" "Reminder: Delivery * today")) { | |
redirect :copy "xyzzy@gmail.com"; | |
} | |
if allof (address :is "from" "leasing@landlord.com", | |
header :is "subject" "Package Notification") { | |
redirect :copy "foo@gmail.com"; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment