(defn

haluk-dogan

"Posts About Functional Programming, Machine Learning, and Linux"

[ Home About Archives RSS ]

isync + notmuch + emacs

September 11, 2020 | By Haluk Dogan

This is my setup for emacs as email client. First, we need to install the required programs for password management (pass), mailbox synchronizer (isync), smtp client (msmtp), and mail indexer and tagger (notmuch, afew).

sudo pacman -S pass isync msmtp notmuch afew

My configuration for mailbox synchronizer ($HOME/.mbsyncrc):

IMAPAccount vivaldi
Host imap.vivaldi.net
User hdogan@vivaldi.net
PassCmd "pass mail/hdogan@vivaldi.net"
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt

IMAPStore vivaldi-remote
Account vivaldi

MaildirStore vivaldi-local
Subfolders Verbatim
Path ~/.mail/hdogan@vivaldi.net/
Inbox ~/.mail/hdogan@vivaldi.net/Inbox

Channel vivaldi
Master :vivaldi-remote:
Slave :vivaldi-local:
Patterns *
Create Both
SyncState *

My configuration for sending email ($HOME/.msmtprc):

defaults
port 587
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt

account vivaldi
host smtp.vivaldi.net
from hdogan@vivaldi.net
auth on
user hdogan@vivaldi.net
passwordeval pass mail/hdogan@vivaldi.net

account default : vivaldi

I initialized notmuch database with notmuch setup with tags unread;inbox;new;sent;flagged;actionable.

I needed to change sendmail-program in Doom Emacs config ($HOME/.doom.d/config.el):

;; Email
; use msmtp
(setq message-send-mail-function 'message-send-mail-with-sendmail)
(setq sendmail-program "/usr/bin/msmtp")
; tell msmtp to choose the SMTP server according to the from field in the outgoing email
(setq message-sendmail-extra-arguments '("--read-envelope-from"))
(setq message-sendmail-f-is-evil 't)

Tags: emacs

)

Copyright © Haluk Dogan