Notmuch mail¶
- Website
- GitHub mirror
- Arch wiki
- Config in
~/.notmuch-config
When is the next run ?
Hooks¶
Hooks can get installed in ~/mail/Mail/.notmuch/hooks
Search¶
Show all mails in \<${EMAIL}> account:
export EMAIL="me@myself.ai"
notmuch search "path:${EMAIL}/**"
notmuch search path:"${EMAIL}/**" and tag:INBOX
notmuch search "('from:root@*.bitmask.net') AND date:today"
Output formats¶
Thread as json:
Single msg as json:
notmuch show --entire-thread=false --format=json \
id:4898FCAE-B024-41B6-91B7-073F40334815@myself.ai | jq . | less
Dump complete mail (only works for single mail, not thread):
List all tags:
Notmuch saved queries¶
See queries:
Set/modify query:
notmuch config set query.leap "tag:/leap/"
notmuch config set query.projects "tag:/projec1|project2/"
notmuch config set query.to-me "to:${EMAIL} OR to:${EMAIL2} OR …"
notmuch config set query.work "from:/example.org|example.com|…/ OR …"
Extract attachments¶
Use ripMIME (AUR package: ripmime)
Or search the web for any notmuch_extract_attachments.py Gist/fork, then:
mkdir /tmp/ausgaben
cd /tmp/ausgaben
notmuch_extract_attachments.py 'tag:Ausgaben AND date:2014'
find . -iname '*.pdf' -exec cp {} ~/Ausgaben/2014/ \;
Exporting emails to PDF¶
Using https://www.whitebyte.info/publications/eml-to-pdf-converter
nsh --format=raw id:kcis.E36D427A37F34E1B88E3962CD680520D@kopano > /tmp/email.eml
email2pdf /tmp/email.eml
evince /tmp/email.eml
Print email¶
Tagging¶
Turn UPPERCASE to lowercase tag:
notmuch tag -INBOX +inbox id:CANu2KkOr3ryGwMiVvO23OaatxvR432JAzyYwpEdkgbfhye6=Qg@mail.gmail.com
notmuch tag -INBOX +inbox tag:INBOX
re-tag all:
Delete mail¶
General issues¶
- moving a already imported mail remotely will result in notmuch not recognizing this, and the folder name tag (i.e. 'inbox' will stay) https://www.mail-archive.com/notmuch@notmuchmail.org/msg19164.html the only way is to complely retag all mails with
with the downside that the imap flag tags get lost (i.e. 'unread')
Index cleartext from gpg encrypted mails¶
Howto:
Configure notmuch to index new incoming encrypted mails:
Reindex old encrypted mails:
Search encrypted mails:
Show mails which failed to get reindex: