A hack to convert a list of email from notmuch to a full-fledged RSS (or maybe Atom?) feed
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is (for now) a rather simple hack to make an RSS feed from mail with a certain tag using notmuch. It's somewhat feed2imap-centered, since that's what I use, and many cleanup hacks for the incoming mail is based on what feed2imap yields.

The newer versions are instead targeting the sluk feed reader.

Also, I'm not really a python wizard, so improvement suggestions are much welcome and needed.

To use

put something like this in ~/.notmuch-to-feedrc


title=My blog
description=This is my recommended stuff!

How it works

First, it uses the cnotmuch bindings to find all entries with your chosen tag. It will then take a number (also specified in the config file) of entries and produce a feed from them. These entries will consist of the first html/mime part of each mail, or, if there isn't one, simply the first part of the mail. If sluk's custom header X-Entry-URL is present, it will be used as link and Guid for the entry, otherwise the first link found in the entry will be used.

Python libraries used

  • python-json
  • PyRSS2Gen
  • notmuch python bindings

Known limitations

  • The HTML mime-part will be included as-is, without any cleaning-up
  • Images are not shown when using the feed2imap image attachment method (with sluk they are)
  • When using the sluk feed reader, the generated feed may be invalid (this is a work in progress)