Skip to content

pivaldi/pi-notmuch

Repository files navigation

PI/notmuch Doom Emacs Module

This is my personal configuration part of Notmuch-Multi in conjunction with 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 Notmuch Address Lookup tool  ;
  • manage multiple sender identities with Gnus Alias.
  • Place 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

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 NOTMUCH-HOOKS manpages.
  • Safely symlinks Notmuch scripts to my personal ~~/bin~ directory which is in the $PATH environment variable.

Prerequisites

  • Use Doom Emacs and the module 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 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 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 :

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

I have something like this in the file custom.el

'(gnus-alias-default-identity "default")
'(gnus-alias-identity-alist
  '(("default" "" "\"Philippe Ivaldi\" <xxxx@ivaldi.fr>" "Ivaldi"
     (("X-Message-SMTP-Method" . "smtp 127.0.0.1")) "" "PI")
    ("ac-montpellier" "default" "\"Ph. Ivaldi\" <xxx@ac-montpellier.fr>"
     "PIPRIME.FR" (("X-Message-SMTP-Method" . "smtp smtp.ac-montpellier.fr")) "" "")
    ("ovya" "default" "\"Philippe Ivaldi\" <xxx@ovya.com>" "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")))

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 :

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published