4.8 KiB
email/notmuch
Table of Contents TOC
Description
Prerequisites
This module requires:
- Either
[[https://github.com/gauteh/lieer][gmailieer]]
(default),mbsync
orofflineimap
(to sync mail with) [[https://notmuchmail.org/][notmuch]]
, to index and tag your downloaded messages.afew
, optionally to initially tag your downloaded messages.
TODO MacOS
Arch Linux
Run one of the following commands.
#sudo pacman -S isync notmuch #mbsync
## OR
#sudo pacman -S offlineimap notmuch
##+END_SRC
See: [[https://wiki.archlinux.org/index.php/Notmuch][Arch Wiki - Notmuch]]
** NixOS
#+BEGIN_SRC nix
environment.systemPackages = with pkgs; [
notmuch
# And one of the following
gmailieer
isync
offlineimap
];
An example of setting up mbsync and notmuch with home-manager
TODO openSUSE
TODO Debian/Ubuntu
TODO Features
Configuration
TODO Gmailier
offlineimap
This module uses Gmailier
by default. To use offlineimap
, change +notmuch-sync-backend
:
(setq +notmuch-sync-backend 'offlineimap)
Next, you need to write a configuration file for offlineimap
. Mine can be found
in my dotfiles repository. It is configured to download mail to \~/.mail
. I
use unix pass to securely store my login credentials. You can find a very
detailed configuration here.
Next you can download your email with offlineimap -o
. This may take a while,
especially if you have thousands of mails.
You can now proceed with the mu and mu4e section.
mbsync
This module uses Gmailier
by default. To use mbsync
, change +notmuch-sync-backend
:
(setq +notmuch-sync-backend 'mbsync)
The steps needed to set up notmuch
with mbsync
are very similar to the ones for
offlineimap.
Start with writing a \~/.mbsyncrc
. An example for GMAIL can be found on
pragmaticemacs.com. A non-GMAIL example is available as a gist here. The manual
page contains all needed information to set up your own.
Next you can download your email with mbsync --all
. This may take a while, but
should be quicker than offlineimap
;).
notmuch
You should have your email downloaded already. If you have not, you need to set
Gmailier
, offlineimap
or mbsync
up before you proceed.
Before you can use notmuch
, you need to index your email initially.
notmuch new
Customize *notmuch-hello*
buffer
It is possible to change the *notmuch-hello*
buffer if you want to.
(use-package! notmuch
:config
(setq notmuch-show-log nil
notmuch-hello-sections `(notmuch-hello-insert-saved-searches
notmuch-hello-insert-alltags)
;; Maybe you don't like seeing email headers when you write email either.
notmuch-message-headers-visible nil))
Changing the notmuch
landing page
You may want to forego the *notmuch-hello*
buffer by having M-x =notmuch
or SPC o m
take you straight to a search page.
When using SPC o m
the +notmuch-home-function
is called. By default it uses the notmuch
function and so has the same familiar behavior of running a vanilla install of notmuch-emacs. But, by overwriting this function you can run a custom search as your landing page.
(setq +notmuch-home-function (lambda () (notmuch-search "tag:inbox")))