Skip to content
justinharter

A Proton and Fastmail “Feed” Sieve Filter

I am mostly putting this here as a note to my future self, but, should anyone want it, I wrote a Sieve filter that automatically captures all the common subject lines, senders, and sender signatures and dumps them into a folder called “The Feed”.

You could change the folder name to anything you want, just modify the line down toward the bottom and the top. Note you’ll need to grab the folder ID for it, too. Yours will differ from this one in mine.

Modify the first few lines to include your actual email address(es) in lieu of “YOU@YOURDOMAIN.COM”.

# -------------------------------------------------------
# Bulk mail detection (ported from Proton filter)
# -------------------------------------------------------

# Guard: Don't filter my own sent mail
if anyof (
  address :is "From" "YOU@YOURDOMAIN.COM",
  address :is "From" "YOU@YOUROTHERDOMAINS.com",
) {
  stop;
}

# Guard: Skip replies I've engaged with
if allof (
  header :contains "Subject" "re:",
  exists "In-Reply-To"
) {
  stop;
}

# TIER 1: RFC-standard bulk headers
if anyof (
  header :matches "List-Unsubscribe" "*",
  header :matches "List-Id" "*",
  header :matches "Precedence" "bulk",
  header :matches "Precedence" "list",
  header :matches "Precedence" "junk",
  header :matches "List-Post" "*",
  header :matches "List-Archive" "*",
  header :matches "List-Help" "*",
  header :matches "List-Subscribe" "*",
  header :matches "Feedback-ID" "*",
  header :matches "X-Feedback-ID" "*",
  header :matches "X-Campaign" "*",
  header :matches "X-Campaign-Id" "*",
  header :matches "X-Mailchimp-Campaign" "*",
  header :matches "X-MC-User" "*",
  header :matches "X-Mailer-LID" "*",
  header :matches "X-Mailer-RecptId" "*",
  header :matches "X-Bulk-Mailer" "*",
  header :matches "X-Sendgrid-EID" "*",
  header :matches "X-SG-EID" "*",
  header :matches "X-Klaviyo-Campaign-Id" "*",
  header :matches "X-HubSpot-Tracking-Id" "*",
  header :matches "X-Marketo-Id" "*",
  header :matches "X-Iterable-Campaign-Id" "*",
  header :matches "X-Brevo-Campaign-Id" "*"
) {
  if mailboxidexists "P5blK" {
    fileinto :mailboxid "P5blK" "INBOX.The Feed";
  }
  stop;
}

# TIER 2: ESP fingerprints in Message-Id / Received
if anyof (
  header :contains "Message-Id" "convertkit",
  header :contains "Message-Id" "substack",
  header :contains "Message-Id" "mailchimp",
  header :contains "Message-Id" "sendgrid",
  header :contains "Message-Id" "klaviyo",
  header :contains "Message-Id" "constantcontact",
  header :contains "Message-Id" "campaign-archive",
  header :contains "Message-Id" "hubspot",
  header :contains "Message-Id" "iterable",
  header :contains "Message-Id" "brevo",
  header :contains "Message-Id" "activecampaign",
  header :contains "Received" "convertkit",
  header :contains "Received" "substack",
  header :contains "Received" "mailchimp",
  header :contains "Received" "klaviyo",
  header :contains "Received" "sendgrid",
  header :contains "Received" "constantcontact",
  header :contains "Received" "ckespa",
  header :contains "Received" "geopod-ismtpd",
  header :contains "Received" "mcsv.net",
  header :contains "Received" "rsgsv.net",
  header :contains "Received" "mta.klv2.com"
) {
  if mailboxidexists "P5blK" {
    fileinto :mailboxid "P5blK" "INBOX.The Feed";
  }
  stop;
}

# TIER 3: No-reply and automated sender patterns
if anyof (
  address :contains "From" "noreply",
  address :contains "From" "no-reply",
  address :contains "From" "donotreply",
  address :contains "From" "do-not-reply",
  address :contains "From" "notifications@",
  address :contains "From" "updates@",
  address :contains "From" "newsletter@",
  address :contains "From" "marketing@",
  address :contains "From" "mailer@",
  address :contains "From" "automated@",
  address :contains "From" "alerts@",
  address :contains "From" "receipts@",
  address :contains "From" "billing@",
  address :contains "From" "orders@",
  address :contains "From" "shipping@",
  address :contains "From" "confirm@",
  address :contains "From" "wordfence",
  address :contains "From" "postmarkapp.com",
  address :contains "From" "toggl.com",
  address :contains "From" "usps.com"
) {
  if mailboxidexists "P5blK" {
    fileinto :mailboxid "P5blK" "INBOX.The Feed";
  }
  stop;
}

# TIER 4: Subject line patterns
if anyof (
  header :contains "Subject" "unsubscribe",
  header :contains "Subject" "update your preferences",
  header :contains "Subject" "manage your subscription",
  header :contains "Subject" "email preferences",
  header :contains "Subject" "no-reply",
  header :contains "Subject" "noreply",
  header :contains "Subject" "do not reply",
  header :contains "Subject" "automated message",
  header :contains "Subject" "automatic reply",
  header :contains "Subject" "notification",
  header :contains "Subject" "newsletter",
  header :contains "Subject" "weekly digest",
  header :contains "Subject" "monthly digest",
  header :contains "Subject" "daily digest",
  header :contains "Subject" "your order",
  header :contains "Subject" "order confirmation",
  header :contains "Subject" "your receipt",
  header :contains "Subject" "your invoice",
  header :contains "Subject" "shipping confirmation",
  header :contains "Subject" "your shipment",
  header :contains "Subject" "tracking number",
  header :contains "Subject" "special offer",
  header :contains "Subject" "limited time",
  header :contains "Subject" "flash sale",
  header :contains "Subject" "activity report",
  header :contains "Subject" "summary for",
  header :contains "Subject" "your weekly",
  header :contains "Subject" "Bing Webmaster Tools",
  header :contains "Subject" "Some plugins were automatically updated",
  header :contains "Subject" "your monthly"
) {
  if mailboxidexists "P5blK" {
    fileinto :mailboxid "P5blK" "INBOX.The Feed";
  }
  stop;
}

Want to know when stuff like this is published?
Sign up for my email list.

Photo of Justin Harter

About JUSTIN HARTER

Justin has been around the Internet long enough to remember when people started saying “content is king”.

He has worked for some of Indiana’s largest companies, state government, taught college-level courses, and about 1.1M people see his work every year.

These days he lives and works in West Michigan.