an initial tagging script for notmuch mail
Switch branches/tags
Clone or download
flokli Merge pull request #206 from nicolasbock/issue_97
Split folders and preserve quoted names
Latest commit 6322531 Sep 20, 2018



GithubTag TravisStatus


afew is an initial tagging script for notmuch mail:

Its basic task is to provide automatic tagging each time new mail is registered with notmuch. In a classic setup, you might call it after 'notmuch new' in an offlineimap post sync hook.

It can do basic thing such as adding tags based on email headers or maildir folders, handling killed threads and spam.

In move mode, afew will move mails between maildir folders according to configurable rules that can contain arbitrary notmuch queries to match against any searchable attributes.

fyi: afew plays nicely with alot, a GUI for notmuch mail ;)


Feel free to ask your questions and discuss usage in the #afewmail IRC Channel on freenode.


  • spam handling (flush all tags, add spam)
  • killed thread handling
  • tags posts to lists with lists, $list-id
  • autoarchives mails sent from you
  • catchall -> remove new, add inbox
  • can operate on new messages [default], --all messages or on custom query results
  • can move mails based on arbitrary notmuch queries, so your sorting may show on your traditional mail client (well, almost ;))
  • has a --dry-run mode for safe testing
  • works with python 2.7, 3.1 and 3.2

Installation and Usage

Full documentation is available in the docs/source directory and in rendered form at

Have fun :)