Commit 2f842714 authored by Guilherme Semente's avatar Guilherme Semente 🌱

Update email support configuration: notmuch, msmtp, message...

parent 912a4792
......@@ -72,6 +72,17 @@ user)."
(setq file (concat "/sudo::" file)))
(find-file file)))
(defun semente-call-or-switch-to-buffer (function buffer-name)
"Invoke FUNCTION if there is no buffer with BUFFER-NAME.
Otherwise switch to the buffer named BUFFER-NAME. Don't clobber
the current buffer."
(if (not (get-buffer buffer-name))
(progn
(split-window-sensibly (selected-window))
(other-window 1)
(funcall function))
(switch-to-buffer-other-window buffer-name)))
(defun semente-switch-to-minibuffer ()
"Switch to minibuffer window."
(interactive)
......@@ -1085,42 +1096,58 @@ You may find other key bindings inside use-package statements."
"E-mail"
(use-package notmuch
:defer
:bind ("C-c r" . 'notmuch)
:bind ("C-c r" . 'semente-notmuch)
:bind ("C-x m" . 'notmuch-mua-mail)
:preface
(defun semente-notmuch ()
(interactive)
(semente-call-or-switch-to-buffer 'semente-notmuch-and-poll "*notmuch-hello*"))
(defun semente-notmuch-and-poll ()
(interactive)
(notmuch-poll)
(notmuch)
(notmuch-refresh-all-buffers))
:config
(setq notmuch-show-logo nil
notmuch-hello-thousands-separator ""
notmuch-fcc-dirs (concat (format-time-string "%Y") " +sent -unread")
notmuch-crypto-process-mime t
mail-user-agent 'message-user-agent)
(setq notmuch-hello-sections
'(notmuch-hello-insert-header
;; notmuch-hello-insert-inbox
notmuch-hello-insert-saved-searches
notmuch-hello-insert-alltags
notmuch-hello-insert-recent-searches))
(setq notmuch-saved-searches
'((:name "inbox" :query "tag:inbox" :key "i")
(:name "unread" :query "tag:unread" :key "u")
(:name "priority" :query "tag:inbox tag:flagged -tag:list -tag:note -tag:junk" :key "p")
(:name "notes" :query "tag:note" :key "n")
(:name "junk" :query "tag:junk" :key "j")
(:name "flagged" :query "tag:flagged" :key "f")
(:name "sent" :query "tag:sent" :key "t")
(:name "drafts" :query "tag:draft" :key "d")
(:name "spam" :query "tag:spam" :key "s")
(:name "all mail" :query "*" :key "a")))
'((:name "inbox" :key "i" :query "tag:inbox" )
(:name "unread" :key "u" :query "tag:unread" )
(:name "flagged" :key "f" :query "tag:flagged")
(:name "last-7d" :key "7" :search-type tree
:query "date:7-days.. OR (date:7-days.. AND (tag:deleted OR tag:spam))")
(:name "blitz" :key "b" :query "tag:blitz")
(:name "list" :key "l" :query "tag:list and tag:unread")
(:name "news" :key "n" :query "tag:news and tag:unread")
(:name "junk" :key "j" :query "tag:junk and tag:unread")
(:name "spam" :key "s" :query "tag:spam" )
(:name "sent" :key "t" :query "tag:sent" )
(:name "drafts" :key "d" :query "tag:draft")
(:name "all mail" :key "a" :query "*")))
(setq notmuch-search-result-format
'(("date" . "%12s ")
("count" . "%s ")
("authors" . "%14s ")
("tags" . "%s ")
("subject" . "%s")))
("count" . "%-7s ")
("authors" . "%-12s ")
("subject" . "%s ")
("tags" . "%s")))
(setq notmuch-tree-result-format
'(("date" . "%12s ")
("authors" . "%-12s ")
((("tree" . "%s")
("subject" . "%s"))
. " %-54s ")
("tags" . "%s")))
(setq notmuch-tag-formats
'(("unread"
(propertize tag 'face 'notmuch-tag-unread))
......@@ -1141,16 +1168,19 @@ You may find other key bindings inside use-package statements."
message-subject-re-regexp
"^[ ]*\\([Rr][Ee][Ss]?\\(\\[[0-9]*\\]\\)*:[ ]*\\)*[ ]*")
;; msmtp
(progn
(setq sendmail-program "/usr/bin/msmtp"
send-mail-function 'sendmail-send-it
mail-specify-envelope-from t
mail-envelope-from 'header)
(setq message-send-mail-function 'message-send-mail-with-sendmail
message-sendmail-extra-arguments '("--read-envelope-from")
message-sendmail-envelope-from 'header
message-sendmail-f-is-evil t)))
;; It has been suggested that 66 character lines are the most readable
(setq message-fill-column 66))
;; msmtp
(progn
(setq sendmail-program "/usr/bin/msmtp"
send-mail-function 'sendmail-send-it
mail-specify-envelope-from t
mail-envelope-from 'header)
(setq message-send-mail-function 'message-send-mail-with-sendmail
message-sendmail-extra-arguments '("--read-envelope-from")
message-sendmail-envelope-from 'header
message-sendmail-f-is-evil t))
;; PGP setup
(progn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment