Add setup for email (one more try...)

This commit is contained in:
larstvei 2022-09-22 07:08:27 +02:00
parent c1bd76fa60
commit c6991cb0e8

View File

@ -592,6 +592,50 @@
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
#+END_SRC #+END_SRC
** Email
I've used Emacs for email in the past, where I've always had the need for a
more standard email client in addition. I'm going to give it another go.
#+BEGIN_SRC emacs-lisp
(defvar load-mail-setup
(and (file-exists-p "~/Maildir")
(executable-find "mbsync")
(executable-find "msmtp")
(executable-find "mu")))
#+END_SRC
I use [[http://www.djcbsoftware.nl/code/mu/mu4e.html][mu4e]] (which is a part of [[http://www.djcbsoftware.nl/code/mu/][mu]]) along with [[https://isync.sourceforge.io/][mbsync]].
#+begin_src emacs-lisp
(when load-mail-setup
(with-eval-after-load 'mu4e
(setq
user-full-name "Lars Tveito" ; Your full name
user-mail-address "larstvei@ifi.uio.no" ; And email-address
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
message-kill-buffer-on-exit t
mu4e-get-mail-command (concat (executable-find "mbsync") " -a")
mu4e-change-filenames-when-moving t
mu4e-user-mail-address-list '("larstvei@ifi.uio.no")
mu4e-maildir-shortcuts '(("/Inbox" . ?i) ("/Sent Items" . ?s))
mu4e-sent-folder "/Sent Items"
mu4e-trash-folder "/Deleted Items"
mu4e-trash-folder "/Drafts"
mu4e-use-fancy-chars t))
(autoload 'mu4e "mu4e" nil t))
#+end_src
** Interactive functions ** Interactive functions
<<sec:defuns>> <<sec:defuns>>
@ -1248,6 +1292,12 @@
(define-key custom-bindings-map (kbd "C-c o") 'olivetti-mode) (define-key custom-bindings-map (kbd "C-c o") 'olivetti-mode)
#+END_SRC #+END_SRC
** Bindings for mu4e
#+begin_src emacs-lisp
(define-key custom-bindings-map (kbd "C-x m") 'mu4e)
#+end_src
** Bindings for built-ins ** Bindings for built-ins
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp