[[https://github.com/Emiller88/dotfiles/blob/319841bd3b89e59b01d169137cceee3183aba4fc/modules/shell/mail.nix][An example of setting up mbsync and notmuch with home-manager]]
Start with writing a ~\~/.mbsyncrc~. An example for GMAIL can be found on
[[http://pragmaticemacs.com/emacs/migrating-from-offlineimap-to-mbsync-for-mu4e/][pragmaticemacs.com]]. A non-GMAIL example is available as a gist [[https://gist.github.com/agraul/60977cc497c3aec44e10591f94f49ef0][here]]. The [[http://isync.sourceforge.net/mbsync.html][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.
;; Maybe you don't like seeing email headers when you write email either.
notmuch-message-headers-visible nil))
#+END_SRC
** 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.