Skip to content

Instantly share code, notes, and snippets.

@merrilymeredith
Created May 31, 2017 16:48
Show Gist options
  • Save merrilymeredith/9eae16f1770b07e9491ec051d354bf54 to your computer and use it in GitHub Desktop.
Save merrilymeredith/9eae16f1770b07e9491ec051d354bf54 to your computer and use it in GitHub Desktop.
Practical sieve examples seem kind of scarce, so...
# 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" "[email protected]" {
addflag "\\seen";
fileinto "Trash";
}
}
if anyof (address :is "to" "[email protected]",
header :is "list-id" "<quux.yahoogroups.com>",
header :is "list-id" "<quux.googlegroups.com>",
address :is "reply-to" "[email protected]") {
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" ["[email protected]",
"[email protected]",
"[email protected]"],
allof (address :is "from" "[email protected]",
header :matches "subject" "Reminder: Delivery * today")) {
redirect :copy "[email protected]";
}
if allof (address :is "from" "[email protected]",
header :is "subject" "Package Notification") {
redirect :copy "[email protected]";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment