Compare commits

..

2 commits

Author SHA1 Message Date
Antoine Martin 2aa01445b0 mu4e tweaks 2022-04-10 00:54:53 +02:00
Antoine Martin 902f0683a0 Adapt email to NixOS setup 2022-04-10 00:52:40 +02:00
2 changed files with 58 additions and 20 deletions

View file

@ -40,10 +40,12 @@
- [[#magit-delta][magit-delta]] - [[#magit-delta][magit-delta]]
- [[#email][Email]] - [[#email][Email]]
- [[#account-configuration][Account configuration]] - [[#account-configuration][Account configuration]]
- [[#sending-mail][Sending mail]]
- [[#reading-plain-text][Reading plain text]]
- [[#disable-org-msg-by-default][Disable =org-msg= by default]] - [[#disable-org-msg-by-default][Disable =org-msg= by default]]
- [[#message-quoting-style][Message quoting style]] - [[#message-quoting-style][Message quoting style]]
- [[#use-gnus-view-for-mu4e][Use Gnus view for =mu4e=]]
- [[#disable-formatflowed][Disable format=flowed]] - [[#disable-formatflowed][Disable format=flowed]]
- [[#dont-permanently-delete-when-trashing-mails][Don't permanently delete when trashing mails]]
- [[#add-git-apply-path-to-mu4e-actions][Add git-apply-path to mu4e actions]] - [[#add-git-apply-path-to-mu4e-actions][Add git-apply-path to mu4e actions]]
* Misc * Misc
@ -489,14 +491,11 @@ documentation).
Setup my main email account. Setup my main email account.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(set-email-account! "alarsyo.net" (set-email-account! "alarsyo"
'((mu4e-sent-folder . "/alarsyo.net/Sent") '((mu4e-sent-folder . "/alarsyo/Sent")
(mu4e-drafts-folder . "/alarsyo.net/Drafts") (mu4e-drafts-folder . "/alarsyo/Drafts")
(mu4e-refile-folder . "/alarsyo.net/Archive") (mu4e-refile-folder . "/alarsyo/Archive")
(mu4e-trash-folder . "/alarsyo.net/Trash") (mu4e-trash-folder . "/alarsyo/Trash")
(smtpmail-smtp-server . "smtp.migadu.com")
(smtpmail-smtp-service . 465)
(smtpmail-stream-type . ssl)
(user-mail-address . "antoine@alarsyo.net") (user-mail-address . "antoine@alarsyo.net")
(user-full-name . "Antoine Martin") (user-full-name . "Antoine Martin")
(mu4e-compose-signature . "Antoine Martin")) (mu4e-compose-signature . "Antoine Martin"))
@ -506,15 +505,36 @@ Setup my main email account.
'((mu4e-sent-folder . "/lrde/Sent") '((mu4e-sent-folder . "/lrde/Sent")
(mu4e-drafts-folder . "/lrde/Drafts") (mu4e-drafts-folder . "/lrde/Drafts")
(mu4e-trash-folder . "/lrde/Trash") (mu4e-trash-folder . "/lrde/Trash")
(smtpmail-smtp-server . "smtp.lrde.epita.fr")
(smtpmail-smtp-service . 587)
(smtpmail-stream-type . starttls)
(user-mail-address . "amartin@lrde.epita.fr") (user-mail-address . "amartin@lrde.epita.fr")
(user-full-name . "Antoine Martin") (user-full-name . "Antoine Martin")
(mu4e-compose-signature . "Antoine Martin")) (mu4e-compose-signature . "Antoine Martin"))
nil) nil)
#+end_src #+end_src
** Sending mail
I use =msmtp= as a SMTP forwarder
#+begin_src emacs-lisp
(after! mu4e
(setq sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail))
#+end_src
** Reading plain text
Ask the =gnus-view= (default viewer used by =mu4e=) to avoid HTML whenever
possible.
#+begin_src emacs-lisp
(after! mu4e
(add-to-list 'mm-discouraged-alternatives "text/html")
(add-to-list 'mm-discouraged-alternatives "text/richtext"))
#+end_src
** Disable =org-msg= by default ** Disable =org-msg= by default
Doom adds a hook, making it impossible to disable. This allows us to toggle it Doom adds a hook, making it impossible to disable. This allows us to toggle it
@ -550,13 +570,6 @@ Has to be duplicated because =mu4e= doesn't use ~message-cite-style~'s values.
message-citation-line-format "%f writes:")) message-citation-line-format "%f writes:"))
#+end_src #+end_src
** Use Gnus view for =mu4e=
#+begin_src emacs-lisp
(after! mu4e
(setq mu4e-view-use-gnus t))
#+end_src
** Disable format=flowed ** Disable format=flowed
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -564,10 +577,35 @@ Has to be duplicated because =mu4e= doesn't use ~message-cite-style~'s values.
(setq mu4e-compose-format-flowed nil)) (setq mu4e-compose-format-flowed nil))
#+end_src #+end_src
** Don't permanently delete when trashing mails
By default =mu4e= sets the =trashed= flag on emails trashed using the =d=
keybinding. This just replaces the action to just move the message to the trash
instead.
See https://github.com/djcb/mu/issues/1136#issuecomment-1066303788, the code
will have to be adapted soon.
#+begin_src emacs-lisp
(after! mu4e
(setf (alist-get 'trash mu4e-marks)
(list :char '("d" . "▼")
:prompt "dtrash"
:dyn-target (lambda (target msg)
(mu4e-get-trash-folder msg))
:action (lambda (docid msg target)
(mu4e~proc-move
docid (mu4e~mark-check-target target) "-N")))))
#+end_src
** Add git-apply-path to mu4e actions ** Add git-apply-path to mu4e actions
#+begin_src emacs-lisp #+begin_src emacs-lisp
(after! mu4e (after! mu4e
;; TODO: upstream this, Doom emacs adds a view in browser action but it seems
;; to be present by default now.
(setq mu4e-view-actions
(remove '("View in browser" . mu4e-action-view-in-browser) mu4e-view-actions))
(add-to-list 'mu4e-view-actions (add-to-list 'mu4e-view-actions
'("GitApply" . mu4e-action-git-apply-patch) t) '("GitApply" . mu4e-action-git-apply-patch) t)
(add-to-list 'mu4e-view-actions (add-to-list 'mu4e-view-actions

View file

@ -172,7 +172,7 @@
yaml ; JSON, but readable yaml ; JSON, but readable
:email :email
;;(mu4e) (mu4e)
;;notmuch ;;notmuch
;;(wanderlust +gmail) ;;(wanderlust +gmail)