From: Amin Bandali Date: Sun, 16 May 2021 00:20:45 +0000 (-0400) Subject: migrate from msmtp (external) to emacs's own smtpmail X-Git-Url: https://git.shemshak.org/gitweb.cgi/~bandali/configs/commitdiff_plain/a220fb5b7ed9e3cf55f0a85bbb11f0f264a0020b?ds=inline migrate from msmtp (external) to emacs's own smtpmail todo: see if it's possible to pin cert fingerprints as with msmtp --- diff --git a/.config/msmtp/config b/.config/msmtp/config deleted file mode 100644 index d255c46..0000000 --- a/.config/msmtp/config +++ /dev/null @@ -1,72 +0,0 @@ -# Set default values for all following accounts. -defaults -port 587 -tls on -auth on -#tls_trust_file /etc/ssl/certs/ca-certificates.crt -logfile ~/.msmtp.log - -account shemshak -host mail.shemshak.org -# use `msmtp -a shemshak --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint -tls_fingerprint 16:BD:BE:20:63:B1:BD:34:C6:E9:5F:1E:98:45:7D:51:E3:3D:3F:27:FC:23:E9:BD:17:A7:A4:96:E7:70:51:BF -tls_starttls on -from amin@shemshak.org -user bandali@shemshak.org -passwordeval gpg --no-tty -q -d ~/.passwd/shemshak.gpg - -account bandali : shemshak -from bandali@shemshak.org -account aminb : shemshak -from amin@aminb.org -account bndl : shemshak -from a@bndl.org - -account gnu -host fencepost.gnu.org -# use `msmtp -a gnu --serverinfo --tls --tls-certcheck=off --tls-fingerprint=` to get the current fingerprint -tls_fingerprint 9D:87:65:25:E1:02:D3:0B:05:27:D3:6A:45:71:31:5F:08:A7:81:5B:1B:1D:CC:84:6A:F8:92:52:BE:46:12:B6 -tls_starttls on -from bandali@gnu.org -user bandali -passwordeval gpg --no-tty -q -d ~/.passwd/gnu.gpg - -account gnu-mab : gnu -from mab@gnu.org -account gnu-aminb : gnu -from aminb@gnu.org -account gnu-amin : gnu -from amin@gnu.org - -account uwaterloo -host connect.uwaterloo.ca -tls_starttls on -from abandali@uwaterloo.ca -user abandali -passwordeval gpg --no-tty -q -d ~/.passwd/uwaterloo.gpg -tls_trust_file /etc/ssl/certs/ca-certificates.crt - -account uwaterloo-friendly : uwaterloo -from bandali@uwaterloo.ca - -account csclub -host mail.csclub.uwaterloo.ca -tls_starttls on -from abandali@csclub.uwaterloo.ca -user abandali -passwordeval gpg --no-tty -q -d ~/.passwd/csclub.gpg -tls_trust_file /etc/ssl/certs/ca-certificates.crt - -account csclub-friendly : csclub -from bandali@csclub.uwaterloo.ca - -account sfl -host mail.savoirfairelinux.com -tls on -from amin.bandali@savoirfairelinux.com -user amin.bandali -passwordeval gpg --no-tty -q -d ~/.passwd/sfl.gpg -tls_trust_file /etc/ssl/certs/ca-certificates.crt - -# Set a default account -account default : shemshak diff --git a/.emacs.d/init.el b/.emacs.d/init.el index d0ea368..29bfbcc 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -671,11 +671,6 @@ Make N (default: 1) copies of the current line or region." ;; Email (with Gnus and message) (require 'bandali-gnus) -(with-eval-after-load 'sendmail - (csetq sendmail-program (executable-find "msmtp") - ;; message-sendmail-extra-arguments '("-v" "-d") - mail-specify-envelope-from t - mail-envelope-from 'header)) (require 'bandali-message) ;; IRC (with ERC) diff --git a/.emacs.d/lisp/bandali-gnus.el b/.emacs.d/lisp/bandali-gnus.el index 15f5bd5..d26e4f9 100644 --- a/.emacs.d/lisp/bandali-gnus.el +++ b/.emacs.d/lisp/bandali-gnus.el @@ -280,7 +280,8 @@ jami:bandali") gnus-message-replysign t gnus-posting-styles '((".*" - (address "bandali@gnu.org")) + (address "bandali@gnu.org") + ("X-Message-SMTP-Method" "smtp fencepost.gnu.org 587")) ("nnimap\\+gnu:l\\..*" (signature nil)) ((header "subject" "ThankCRM") @@ -289,23 +290,27 @@ jami:bandali") (eval (setq b/message-cite-say-hi nil))) ("nnimap\\+shemshak:.*" (address "amin@shemshak.org") + ("X-Message-SMTP-Method" "smtp mail.shemshak.org 587") (body "\nBest,\n") (signature b/shemshak-signature) (gcc "nnimap+shemshak:Sent") (eval (setq b/message-cite-say-hi t))) ("nnimap\\+uwaterloo:.*" (address "bandali@uwaterloo.ca") + ("X-Message-SMTP-Method" "smtp connect.uwaterloo.ca 587") (body "\nBest,\n") (signature b/uwaterloo-signature)) ("nnimap\\+uwaterloo:INBOX" (gcc "\"nnimap+uwaterloo:Sent Items\"")) ("nnimap\\+csc:.*" (address "bandali@csclub.uwaterloo.ca") + ("X-Message-SMTP-Method" "smtp mail.csclub.uwaterloo.ca 587") (signature b/csc-signature) (gcc "nnimap+csc:Sent")) ("nnimap\\+sfl:.*" (address "amin.bandali@savoirfairelinux.com") (signature b/sfl-signature) + ("X-Message-SMTP-Method" "smtp mail.savoirfairelinux.com 587") (gcc "nnimap+sfl:Sent") (eval (setq-local b/sfl-p t)))))) ;; hooks diff --git a/.emacs.d/lisp/bandali-message.el b/.emacs.d/lisp/bandali-message.el index c66a669..e7a0fa4 100644 --- a/.emacs.d/lisp/bandali-message.el +++ b/.emacs.d/lisp/bandali-message.el @@ -55,8 +55,7 @@ message-citation-line-format "%N writes:\n" message-citation-line-function 'message-insert-formatted-citation-line message-kill-buffer-on-exit t - message-send-mail-function 'message-send-mail-with-sendmail - message-sendmail-envelope-from 'header + message-send-mail-function #'smtpmail-send-it message-subscribed-address-functions '(gnus-find-subscribed-addresses) message-dont-reply-to-names