Skip to content

Instantly share code, notes, and snippets.

@ticky
Last active September 17, 2023 19:41
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ticky/308db0f7dab890546e5a194504230d00 to your computer and use it in GitHub Desktop.
Save ticky/308db0f7dab890546e5a194504230d00 to your computer and use it in GitHub Desktop.

Patreon Mail Forwarder

This is a Sieve script I've added to my Fastmail email service to redirect my Patreon emails to my Feedbin RSS reader service.

This now means I can catch up with the creators I'm supporting in a linear message format, with separate feeds per creator, in my own choice of phone and desktop apps again!

Instructions

  1. You'll need to have Fastmail, or another email service which offers custom Sieve scripting for incoming emails.
  2. Get your Feedbin Newsletter email address. You can find it at https://feedbin.com/settings.
  3. Find your Sieve rule editor. On Fastmail it's at https://www.fastmail.com/settings/rules.
  4. Paste the contents of Patreon Mail Forwarder.sieve into your email service's rules. You'll need to ensure the regex extension is available and loaded (with require ["regex"]; at the top of the file).
  5. Ensure Patreon is configured to send emails from the creators you want fed into your RSS reader

Testing and updating

  • Fastmail host a Sieve testing tool, which requires your rule (with explicit extension loading! See item 4 above)
  • You need to get a plain-text copy of your email
    • On macOS Mail that's available by viewing your message and selecting View -> Message -> All Source, or pressing ⌥⌘U
    • In Fastmail this is available by selecting More -> Show Raw Message.
  • Notably, Sieve's regular expression engine is basic POSIX regular expressions, so it lacks a lot of modern conveniences, including selectors for whitespace characters. It can take some fiddling to get it working, especially on emoji!
### Patreon email sorting-and-forwarding to Feedbin
if
allof(
address :matches "From" "*patreon.com",
header :regex "Subject" "^(?:[^ ]{0,4}(?: Vote in)?) (.*)(?:(?:'s | posted| just shared:?)(?: [0-9]+ )?(?:new(?: patron-only)? (?:images|poll|video|release):)?) \"(.*)\".*$"
)
{
deleteheader "From";
addheader "From" "${1} <\"${1}\"@patreon.com>";
deleteheader "Subject";
addheader "Subject" "${2}";
redirect "<your-feedbin-newsletter-id>@newsletters.feedbin.com";
discard;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment