An open API service indexing awesome lists of open source software.

https://github.com/pivaldi/pi-notmuch

My personal Notmuch Doom Emacs Module on top of PIMacs/notmuch
https://github.com/pivaldi/pi-notmuch

emacs emacs-configuration mail notmuch

Last synced: over 1 year ago
JSON representation

My personal Notmuch Doom Emacs Module on top of PIMacs/notmuch

Awesome Lists containing this project

README

          

#+title: PI/notmuch Doom Emacs Module

This is my personal configuration part of
[[https://github.com/pivaldi/notmuch-multi][Notmuch-Multi]] in conjunction with
[[https://github.com/pivaldi/pimacs/notmuch][pimacs/Notmuch]].

* Features
With this configuration you can see how :
- Manage smartly multiple email accounts through Notmuch-Multi (see
screenshots) ;
- The default Notmuch Key binding "j" permits to select one account by
corresponding account prefix and next the corresponding key tag.
- In the ~Notmuch Hello~ screen, the Notmuch default key "G" synchronize the
remote mails with local mails and apply the configured tags of new mails.
- Implement mail completion composing message with both ~BBDB~ and
[[https://github.com/aperezdc/notmuch-addrlookup-c][Notmuch Address Lookup tool ]] ;
- [[https://notmuchmail.org/emacstips/#index15h2][manage multiple sender identities]]
with [[https://www.emacswiki.org/emacs/GnusAlias][Gnus Alias]].
- Place [[https://notmuchmail.org/manpages/notmuch-hooks-5/][Notmuch hooks]] so
that so that the command ~notmuch new~ automatically move local mails to the
right directory depending tags, retrieve remote mails with ~mbsync~ and tags
new local mails using the tags' file configuration [[.notmuch-tagging]] and [[.notmuch-tagging-ovya]].

* Screenshots
[[https://github.com/pivaldi/notmuch-multi][See Notmuch-Multi]].

* Installation
The script [[install.sh]] does this :
- Safely symlinks ~~/Documents/mail/~ to ~~/Mail/~ (default value of my environment variable
~$MAILDIR~) because my important files are located in ~~/Documents/~.
- Create the accounts' directories ~ivaldi.me~ and ~ovya.fr~ into ~$MAILDIR~.
- Safely symlinks Notmuch hooks script to ~~/Mail/.notmuch/hooks~.
See [[https://notmuchmail.org/manpages/notmuch-hooks-5/][NOTMUCH-HOOKS
manpages]].
- Safely symlinks Notmuch scripts to my personal ~~/bin~ directory which is in
the ~$PATH~ environment variable.
- [[notmuch-tag-do.sh]] : Tags all new mails
- [[notmuch-tag-move.sh]] : move local mails to the related directories
depending of tags values. For example, mail tagged "delete" will be removed.
- [[notmuch-notify.sh]] : notify with desktop popup when new mails are imported.

* Prerequisites
- Use Doom Emacs and the module
[[https://github.com/pivaldi/pimacs/notmuch][pimacs/Notmuch]].
In order use the latest installed Notmuch Emacs UI instead of the version
provided by Doom, *IT IS IMPORTANT TO RUN ~doom sync -u~*.
- Install [[https://github.com/aperezdc/notmuch-addrlookup-c][Notmuch Address Lookup tool ]]
from source code (because I use the latest Emacs Notmuch UI).
- The source of the Notmuch Emacs UI must be in the directory
~/usr/local/share/emacs/site-lisp~ (see the file [[packages.el]])

*If you don't use Doom Emacs, the file [[config.el]] is easy to convert to pure*
*Emacs lisp and you must install yourself the package [[https://github.com/pivaldi/notmuch-multi][Notmuch-Multi]].*

* Postconfig

When ~gnus-alias~ was loaded the following commands must be used to set yours
identities and the rules to choice the correct identity :

#+begin_src
M-x describe-variable RET gnus-alias-identity-alist
M-x describe-variable RET gnus-alias-identity-rules
M-x describe-variable RET gnus-alias-default-identity
#+end_src

I have something like this in the file ~custom.el~

#+begin_src elisp
'(gnus-alias-default-identity "default")
'(gnus-alias-identity-alist
'(("default" "" "\"Philippe Ivaldi\" " "Ivaldi"
(("X-Message-SMTP-Method" . "smtp 127.0.0.1")) "" "PI")
("ac-montpellier" "default" "\"Ph. Ivaldi\" "
"PIPRIME.FR" (("X-Message-SMTP-Method" . "smtp smtp.ac-montpellier.fr")) "" "")
("ovya" "default" "\"Philippe Ivaldi\" " "OVYA"
(("X-Message-SMTP-Method" . "smtp smtp.gmail.com xxx@ovya.com")) ""
"Philippe Ivaldi, etc…")))
'(gnus-alias-identity-rules
'(("ac-montpellier" ("any" ".*ac-montpellier.fr.*" previous) "ac-montpellier")
("ovya_to" ("any" ".*@ovya.*" current) "ovya")
("ovya"
("any"
"\\(.*@ovya.*\\)\\|\\(.*@costes.*\\)\\|\\(.*@returnpath.com\\)"
both)
"ovya")))
#+end_src

Note the field ~X-Message-SMTP-Method~ in the identities to configure each smtp server depending
the sender identity that correspond to an entry in the encrypted file
~~/.authinfo.gpg~ like this :

#+begin_src txt
machine 127.0.0.1 login xxx@ivaldi.fr password xxxxxxxxxxxxxx port 1025
machine smtp.ac-montpellier.fr login xxx password xxxxxxxxxxx port 587
machine smtp.gmail.com login xxxx@ovya.com password xxxxxxxxxx port 587
#+end_src