├── filters ├── fileUnknown.md ├── fileByRecipient.md ├── fileSent.md ├── real-estate.md ├── fileByContactGroup.md ├── hiking.md ├── health.md ├── filebyMailingList.md ├── pets.md ├── legal.md ├── food-and-drink.md ├── social.md ├── utilities.md ├── coffee.md ├── insurance.md ├── gaming.md ├── travel.md ├── annonDaddySender.md ├── 00-ads.md ├── reservations.md ├── investing.md ├── 00-testing.md ├── tech.md ├── simpleLoginLabel.md ├── 02-statements.md ├── family-and-friends.md ├── 01-security.md ├── finance.md ├── government.md └── zz-orders-and-shipping.md ├── .github └── workflows │ ├── header.md │ └── assemble_md.yml └── README.md /filters/fileUnknown.md: -------------------------------------------------------------------------------- 1 | ## File unkown senders 2 | 3 | If the email address isn't in any contact groups, move it into a folder named SCREENER 4 | 5 | ~~~sieve 6 | require ["extlists", "fileinto"]; 7 | 8 | if not header :list "from" ":addrbook:personal?label=*" 9 | { 10 | fileinto "Screener"; 11 | stop; 12 | } 13 | ~~~ 14 | -------------------------------------------------------------------------------- /filters/fileByRecipient.md: -------------------------------------------------------------------------------- 1 | ## File by recipient 2 | 3 | File into specific folder for a chosen recipient email address. 4 | 5 | ~~~sieve 6 | require ["fileinto", "comparator-i;ascii-numeric"]; 7 | 8 | if allof (address :all :comparator "i;unicode-casemap" :is ["To", "Cc", "Bcc"] "NAME@YOUREMAIL.COM") { 9 | fileinto "FOLDERNAME"; 10 | } 11 | ~~~ 12 | -------------------------------------------------------------------------------- /filters/fileSent.md: -------------------------------------------------------------------------------- 1 | ## File all sent emails 2 | 3 | This prevents your sent emails showing up in other folders. 4 | Create an addressbook called "myself" and input all your email addresses. 5 | 6 | ~~~sieve 7 | require ["include", "fileinto", "extlists"]; 8 | 9 | if header :list "from" ":addrbook:myself" 10 | { 11 | fileinto "sent"; 12 | return; 13 | } 14 | ~~~ 15 | -------------------------------------------------------------------------------- /filters/real-estate.md: -------------------------------------------------------------------------------- 1 | ## real-estate 2 | 3 | Commonly used real estate platforms 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used real estate platforms 9 | if address :matches :domain "from" ["*zillow.com", "*better.com", "*redfin.com"] 10 | { 11 | fileinto "Real Estate"; 12 | expire "day" "365"; 13 | stop; 14 | } 15 | ~~~ 16 | -------------------------------------------------------------------------------- /.github/workflows/header.md: -------------------------------------------------------------------------------- 1 | # Awesome Sieve Filters 2 | 3 | A repo of useful sieve filters by the community. 4 | This is mainly aimed at [ProtonMail](https://mail.proton.me) filters, 5 | but they should work with any sieve filter interpreter. 6 | See [here](https://proton.me/support/sieve-advanced-custom-filters) for the Proton sieve filter docs. 7 | 8 | --- 9 | 10 | 11 | 12 | 13 | --- 14 | -------------------------------------------------------------------------------- /filters/fileByContactGroup.md: -------------------------------------------------------------------------------- 1 | ## File by contact group name 2 | 3 | If the email comes from an address listed in the a contact group. 4 | You need to create a contact group for every folder you have. 5 | 6 | ~~~sieve 7 | require ["extlists", "fileinto"]; 8 | 9 | if header :list "from" ":addrbook:personal?label=CONTACTGROUPNAME" 10 | { 11 | fileinto "FOLDERNAME"; 12 | fileinto "LABEL"; 13 | } 14 | ~~~ 15 | -------------------------------------------------------------------------------- /filters/hiking.md: -------------------------------------------------------------------------------- 1 | ## hiking 2 | 3 | Commonly used hiking services 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used hiking services 9 | if address :matches :domain "from" ["*garmin.com", "*gaiagps.com", "*nextmilemeals.com", "*alltrails.com", "*opensummit.com"] 10 | { 11 | fileinto "Hiking"; 12 | expire "day" "365"; 13 | stop; 14 | } 15 | ~~~ 16 | -------------------------------------------------------------------------------- /filters/health.md: -------------------------------------------------------------------------------- 1 | ## health 2 | 3 | Commonly used health services 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used health services 9 | if address :matches :domain "from" ["*carefirst.com", "*ibx.com", "*ibx2.com", "*metlife.com", "*eyemed.com", "*vsp.com", "*teladoc.com", "*lenscrafters.com"] 10 | { 11 | fileinto "Health"; 12 | expire "day" "365"; 13 | stop; 14 | } 15 | ~~~ 16 | -------------------------------------------------------------------------------- /filters/filebyMailingList.md: -------------------------------------------------------------------------------- 1 | ## File By Mailing List 2 | 3 | If the email comes from a valid account in address group, but also is a mailing list 4 | 5 | ~~~sieve 6 | require ["extlists", "fileinto", "vnd.proton.expire"]; 7 | 8 | If allof ( 9 | exists "List-Unsubscribe", 10 | header :list "from" ":addrbook:personal?label=GROUPNAME" 11 | ) { 12 | addflag "\\Seen"; 13 | fileinto "FOLDERNAME"; 14 | expire "day" "3"; 15 | } 16 | ~~~ 17 | -------------------------------------------------------------------------------- /filters/pets.md: -------------------------------------------------------------------------------- 1 | ## pets 2 | 3 | Commonly used pet vendors 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used pet vendors 9 | if address :matches :domain "from" ["*petco.com", "*litterbox.com", "*chewy.com", "*litter-robot.com", "*foundanimals.org", 10 | "*openfarmpet.com", "*truthaboutpetfood.com", "*found.org"] 11 | { 12 | fileinto "Pets"; 13 | expire "day" "365"; 14 | stop; 15 | } 16 | ~~~ 17 | -------------------------------------------------------------------------------- /filters/legal.md: -------------------------------------------------------------------------------- 1 | ## legal 2 | 3 | Commonly used legal platforms 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used legal platforms 9 | if address :matches :domain "from" ["*docusign.net"] 10 | { 11 | # This is purely extra protection in the event the sieves don't work as expected 12 | if hasexpiration 13 | { 14 | unexpire; 15 | } 16 | fileinto "Legal"; 17 | stop; 18 | } 19 | ~~~ 20 | -------------------------------------------------------------------------------- /filters/food-and-drink.md: -------------------------------------------------------------------------------- 1 | ## food-and-drink 2 | 3 | Commonly used food vendors 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used food vendors 9 | if address :matches :domain "from" ["*highkey.com", "*highkeysnacks.com", "*doordash.com", "*instacart.com", "*papajohns.com", 10 | "*yelp.com", "*grubhub.com", "*postmates.com"] 11 | { 12 | fileinto "Food and Drink"; 13 | expire "day" "365"; 14 | stop; 15 | } 16 | ~~~ 17 | -------------------------------------------------------------------------------- /filters/social.md: -------------------------------------------------------------------------------- 1 | ## social 2 | 3 | Commonly used social networks 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used social networks 9 | if address :matches :domain "from" ["*linkedin.com", "*facebookmail.com", "*facebook.com", "*reddit.com", "*twitter.com", "*instagram.com", "*pinterest.com", "*meetup.com", "*tumblr.com", "*ycombinator.com"] 10 | { 11 | fileinto "Social"; 12 | expire "day" "365"; 13 | stop; 14 | } 15 | ~~~ 16 | -------------------------------------------------------------------------------- /filters/utilities.md: -------------------------------------------------------------------------------- 1 | ## utilities 2 | 3 | Commonly used utilities 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used utilities 9 | if address :matches :domain "from" ["*bge.com", "*comcast.net", "*xfinity.com", "*t-mobile.com", "*att.com", "*spectrum.com", "*verizon.com", "*verizonwireless.com", "*rentcafe.com", "*duke-energy.com"] 10 | { 11 | fileinto "Finance/Utilities"; 12 | expire "day" "365"; 13 | stop; 14 | } 15 | ~~~ 16 | -------------------------------------------------------------------------------- /filters/coffee.md: -------------------------------------------------------------------------------- 1 | ## coffee 2 | 3 | Commonly used coffee sites 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used coffee sites 9 | if address :matches :domain "from" ["*counterculturecoffee.com", "*birdrockcoffee.com", "*jbccoffeeroasters.com", 10 | "*madcapcoffee.com", "*georgehowellcoffee.com", "*onyxcoffeelab.com", "*swiftcupcoffee.com", "*nespresso.com"] 11 | { 12 | fileinto "Coffee"; 13 | expire "day" "365"; 14 | stop; 15 | } 16 | ~~~ 17 | -------------------------------------------------------------------------------- /filters/insurance.md: -------------------------------------------------------------------------------- 1 | ## insurance 2 | 3 | Commonly used insurance providers 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used insurance providers 9 | if address :matches :domain "from" ["*allstate.com", "*allstate-email.com", "*geico.com", "*geicomail.com", "*jminsure.com", 10 | "*travelguard.com", "*nationwide.com", "*progressive.com", "*statefarm.com", "*travelers.com", "*assurant.com"] 11 | { 12 | fileinto "Finance/Insurance"; 13 | expire "day" "365"; 14 | stop; 15 | } 16 | ~~~ 17 | -------------------------------------------------------------------------------- /filters/gaming.md: -------------------------------------------------------------------------------- 1 | ## gaming 2 | 3 | Commonly used gaming services 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used gaming services 9 | if address :matches :domain "from" ["*steampowered.com", "*xbox.com", "*nintendo.net", "*nintendo.com", "*greenmangaming.com", 10 | "*epicgames.com", "*ea.com", "*playstationemail.com", "*rockstargames.com", "*twitch.tv", "*ubi.com", "*blizzard.com", "*bethesda.net"] 11 | { 12 | fileinto "Gaming"; 13 | expire "day" "365"; 14 | stop; 15 | } 16 | ~~~ 17 | -------------------------------------------------------------------------------- /filters/travel.md: -------------------------------------------------------------------------------- 1 | ## travel 2 | 3 | Commonly used travel services 4 | 5 | ~~~sieve 6 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 7 | 8 | # Commonly used travel services 9 | if address :matches :domain "from" ["*southwest.com", "*hyatt.com", "*airbnb.com", 10 | "*lyftmail.com", "*uber.com", "*hertz.com", "*alaskaair.com", "*delta.com", 11 | "*goalamo.com", "*avis.com", "*ihg.com", "*kimptonhotels.com", "*hotels.com", 12 | "*marriott.com", "*tripadvisor.com", "*aa.com", "*autoslash.com", "*priceline.com"] 13 | { 14 | fileinto "Travel"; 15 | expire "day" "730"; 16 | stop; 17 | } 18 | ~~~ 19 | -------------------------------------------------------------------------------- /filters/annonDaddySender.md: -------------------------------------------------------------------------------- 1 | ## AnonDaddy specific sender 2 | This example is using Anonaddy alias forwarding, but the field in the header can be adjusted to be SimpleLogin or even the base Proton header fields. 3 | Placing Seen first ensures it works. If you use the expire command seen will not work unless it is first - confirmed by Proton mods. 4 | Expire will delete email after stated days. 5 | 6 | ~~~sieve 7 | require ["imap4flags", "fileinto", "vnd.proton.expire"]; 8 | 9 | if header :matches "X-Anonaddy-Original-Sender" ["SENDER@EMAIL.com"]{ 10 | addflag "\\Seen"; 11 | fileinto "FOLDERNAME"; 12 | expire "day" "3"; 13 | } 14 | ~~~ 15 | -------------------------------------------------------------------------------- /filters/00-ads.md: -------------------------------------------------------------------------------- 1 | ## 00-ads 2 | 3 | If "list-unsubscribe" header present, flag for easy manual review 4 | Ads is a label, NOT a folder 5 | 6 | ~~~sieve 7 | require ["fileinto", "imap4flags"]; 8 | 9 | # allowlist - do NOT tag as advertising 10 | if address :matches :domain "from" ["*personalcapital.com", "*robinhood.com", "*nerdwallet.com"] 11 | { 12 | # do nothing 13 | } 14 | 15 | # If "list-unsubscribe" header present, flag for easy manual review 16 | # Ads is a label, NOT a folder 17 | elsif exists "list-unsubscribe" 18 | { 19 | fileinto "Ads"; 20 | } 21 | 22 | # do NOT stop executing, allow other sieves to continue processing 23 | ~~~ 24 | -------------------------------------------------------------------------------- /filters/reservations.md: -------------------------------------------------------------------------------- 1 | ## reservations 2 | 3 | General catch all for appointments 4 | More targeted, specific reservation websites 5 | 6 | ~~~sieve 7 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 8 | 9 | # General catch all for appointments 10 | if header :contains "subject" ["appointment"] 11 | { 12 | fileinto "Reservations"; 13 | expire "day" "365"; 14 | stop; 15 | } 16 | 17 | # More targeted, specific reservation websites 18 | elsif address :matches :domain "from" ["*seatme.com", "*opentable.com", "*resy.com", "*exploretock.com"] 19 | { 20 | fileinto "Reservations"; 21 | expire "day" "365"; 22 | stop; 23 | } 24 | ~~~ 25 | -------------------------------------------------------------------------------- /filters/investing.md: -------------------------------------------------------------------------------- 1 | ## investing 2 | 3 | For Robinhood Snacks 4 | Route to main inbox 5 | Commonly used investing platforms 6 | 7 | ~~~sieve 8 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 9 | 10 | # For Robinhood Snacks 11 | # Route to main inbox 12 | if header :contains "from" "Robinhood Snacks" 13 | { 14 | expire "day" "3"; 15 | stop; 16 | } 17 | 18 | # Commonly used investing platforms 19 | elsif address :matches :domain "from" ["*troweprice.com", "*e-vanguard.com", "*vanguard.com", "*m1finance.com", "*coinbase.com", "*robinhood.com", "*fidelity.com", "*prudential.com"] 20 | { 21 | fileinto "Finance/Investing"; 22 | expire "day" "365"; 23 | stop; 24 | } 25 | ~~~ 26 | -------------------------------------------------------------------------------- /filters/00-testing.md: -------------------------------------------------------------------------------- 1 | ## 00-testing 2 | 3 | This sieve is useful for testing. 4 | Create a contact group and name it "Self". 5 | Add your personal e-mail addresses to this group. 6 | You can alternatively use ":addrbook:myself" 7 | but I prefer to test with external addresses. 8 | 9 | ~~~sieve 10 | require ["fileinto", "extlists", "vnd.proton.expire"]; 11 | 12 | # This sieve is useful for testing. 13 | # Create a contact group and name it "Self". 14 | # Add your personal e-mail addresses to this group. 15 | # You can alternatively use ":addrbook:myself" 16 | # but I prefer to test with external addresses. 17 | if header :list "from" ":addrbook:personal?label=Self" 18 | { 19 | # do things 20 | } 21 | ~~~ 22 | -------------------------------------------------------------------------------- /filters/tech.md: -------------------------------------------------------------------------------- 1 | ## tech 2 | 3 | Commonly used tech services 4 | Security has it's own folder - don't put tech security services here. 5 | 6 | ~~~sieve 7 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 8 | 9 | # Commonly used tech services 10 | # Security has it's own folder - don't put tech security services here. 11 | if address :matches :domain "from" ["*digitalocean.com", "*github.com", 12 | "*cloudflare.com", "*docker.com", "*heroku.com", "*keybase.io", "*adobe.com", 13 | "*netflix.com", "*google.com", "*youtube.com", "*apple.com", "*roku.com", 14 | "*namecheap.com", "*microsoft.com", "*ebay.com", "*spotify.com", "*plex.tv", "*logitech.com"] 15 | { 16 | fileinto "Tech"; 17 | expire "day" "365"; 18 | stop; 19 | } 20 | ~~~ 21 | -------------------------------------------------------------------------------- /filters/simpleLoginLabel.md: -------------------------------------------------------------------------------- 1 | ## SimpleLogin Labels 2 | 3 | This filter automatically sets label for emails sent to SimpleLogin aliases. For example, any email sent to alias `paypal.XXXX@slmail.me` will be labeled as `Paypal`. 4 | 5 | ~~~sieve 6 | require ["include", "environment", "variables", "relational", "comparator-i;ascii-numeric", "spamtest", "fileinto"]; 7 | 8 | if allof (address :all :comparator "i;unicode-casemap" :matches "From" "*simplelogin.co", 9 | address :all :matches "To" "*.*@*") # The "To" address condition is used to get the first part (before the dot) 10 | { 11 | set :lower :upperfirst "labelvar" "${1}"; # ${1} contains the part before the dot, then we capitalize the first letter 12 | fileinto "${labelvar}"; # Apply the label 13 | } 14 | ~~~ 15 | -------------------------------------------------------------------------------- /filters/02-statements.md: -------------------------------------------------------------------------------- 1 | ## 02-statements 2 | 3 | If the string "statement" is found in the subject, set an expiration of 365 days. 4 | These are almost always informational/no-action emails and only useful for a few minutes, but set a high expiration to be safe. 5 | do NOT stop executing, allow other sieves to continue processing 6 | 7 | ~~~sieve 8 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 9 | 10 | # If the string "statement" is found in the subject, set an expiration of 365 days. 11 | # These are almost always informational/no-action emails and only useful for a few minutes, but set a high expiration to be safe. 12 | if header :contains "subject" "statement" 13 | { 14 | expire "day" "365"; 15 | } 16 | 17 | # do NOT stop executing, allow other sieves to continue processing 18 | ~~~ 19 | -------------------------------------------------------------------------------- /filters/family-and-friends.md: -------------------------------------------------------------------------------- 1 | ## family-and-friends 2 | 3 | Checks if sender is in personal address book with a "Family" group association 4 | Checks if sender is in personal address book with a "Friend" group association 5 | 6 | ~~~sieve 7 | require ["fileinto", "extlists", "vnd.proton.expire"]; 8 | 9 | # Checks if sender is in personal address book with a "Family" group association 10 | if header :list "from" ":addrbook:personal?label=Family" 11 | { 12 | # This is purely extra protection in the event the sieves don't work as expected 13 | if hasexpiration 14 | { 15 | unexpire; 16 | } 17 | fileinto "Family"; 18 | stop; 19 | } 20 | 21 | # Checks if sender is in personal address book with a "Friend" group association 22 | elsif header :list "from" ":addrbook:personal?label=Friends" 23 | { 24 | # This is purely extra protection in the event the sieves don't work as expected 25 | if hasexpiration 26 | { 27 | unexpire; 28 | } 29 | fileinto "Friends"; 30 | stop; 31 | } 32 | ~~~ 33 | -------------------------------------------------------------------------------- /filters/01-security.md: -------------------------------------------------------------------------------- 1 | ## 01-security 2 | 3 | This sieve is high up in the execution chain, as we want to short-circuit these from other sieves and centralize all security events. 4 | Common subjects relevant to security events 5 | Commonly used security services 6 | 7 | ~~~sieve 8 | require ["fileinto", "imap4flags", "vnd.proton.expire"]; 9 | 10 | # This sieve is high up in the execution chain, as we want to short-circuit these from other sieves and centralize all security events. 11 | 12 | # Common subjects relevant to security events 13 | if header :contains "subject" ["security alert", "security notification", "login", "sign-on", 14 | "sign-in", "sign in", "sign on", "email address", "email change", "password", "terms of service"] 15 | { 16 | fileinto "Security"; 17 | expire "day" "365"; 18 | stop; 19 | } 20 | 21 | # Commonly used security services 22 | elsif address :matches :domain "from" ["*lastpass.com", "*logme.in", "*okta.com", "*accounts.google.com", 23 | "*1password.com", "*haveibeenpwned.com", "*nextdns.io"] 24 | { 25 | fileinto "Security"; 26 | expire "day" "365"; 27 | stop; 28 | } 29 | ~~~ 30 | -------------------------------------------------------------------------------- /.github/workflows/assemble_md.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Compile And Publish Page 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | jobs: 11 | Compile-And-Publish: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | - run: mkdir public && cat .github/workflows/header.md filters/* > public/index.md 16 | - run: wget https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc && chmod a+x gh-md-toc 17 | - run: ./gh-md-toc --insert public/index.md 18 | - name: Converts Markdown to HTML 19 | uses: jaywcjlove/markdown-to-html-cli@main 20 | with: 21 | source: public/index.md 22 | output: public/index.html 23 | github-corners: https://github.com/LoricAndre/awesome-sieve-filters 24 | dark-mode: false 25 | description: Awesome Sieve Filters 26 | - run: sed -z -i 's;
;