.emacs.d/init.d/misc/email.el

69 lines
2.6 KiB
EmacsLisp
Raw Normal View History

2020-03-28 02:09:04 +01:00
;;; email.el --- Email setup -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(require 'basics/package-management)
(when (and (executable-find "mu")
(or (file-exists-p "~/email/tzend")
(file-exists-p "~/.maildir")))
2020-03-28 02:09:04 +01:00
(use-package mu4e
:straight nil ; Installed by package “mu”.
2020-03-28 12:43:31 +01:00
:after (ivy smtpmail)
2020-03-28 02:09:04 +01:00
:commands (mu4e-get-maildirs
mu4e-mark-handle-when-leaving
mu4e-headers-search)
:functions (ivy-completing-read)
:custom ((mu4e-maildir "~/email/tzend")
(mu4e-trash-folder "/Trash")
(mu4e-sent-folder "/Sent")
(mu4e-drafts-folder "/Drafts")
2020-03-31 16:26:32 +02:00
(mu4e-refile-folder "/Keep")
2020-03-28 02:09:04 +01:00
(mu4e-get-mail-command "mbsync -c ~/.config/mbsync/config tzend")
(mu4e-update-interval (* 60 10))
(mu4e-use-fancy-chars t)
(mu4e-view-show-images t)
(mu4e-view-show-addresses t)
;; Don't render HTML.
(mu4e-view-html-plaintext-ratio-heuristic most-positive-fixnum)
(mu4e-attachment-dir "~/Downloads")
2020-03-31 01:56:06 +02:00
(mu4e-compose-signature-auto-include t)
2020-03-28 12:10:07 +01:00
(mu4e-user-agent-string nil)
(mail-user-agent #'mu4e-user-agent))
2020-03-28 02:09:04 +01:00
:config (progn
2020-03-31 01:56:06 +02:00
;; When we are on the mail-server.
(when (file-exists-p "~/.maildir")
(custom-set-variables
'(mu4e-maildir "~/.maildir")
2020-03-31 16:26:32 +02:00
'(mu4e-trash-folder "/.Trash")
'(mu4e-sent-folder "/.Sent")
'(mu4e-drafts-folder "/.Drafts")
'(mu4e-refile-folder "/.Keep")
2020-03-31 01:56:06 +02:00
'(mu4e-get-mail-command "true")
'(mu4e-update-interval nil)))
2020-03-28 02:09:04 +01:00
(defun mu4e~headers-jump-to-maildir ()
"Overload that uses ivy."
(interactive)
(let ((maildir (ivy-completing-read
"Jump to maildir: " (mu4e-get-maildirs))))
(when maildir
(mu4e-mark-handle-when-leaving)
(mu4e-headers-search (format "maildir:\"%s\"" maildir))))))
:bind ("C-X m" . mu4e)))
(use-package smtpmail
:defer 4
2020-03-28 02:09:04 +01:00
:custom ((message-send-mail-function #'smtpmail-send-it)
(mu4e-sent-messages-behavior 'sent)
2020-03-31 01:56:06 +02:00
(smtpmail-smtp-server "mail.tzend.de")
2020-03-28 02:09:04 +01:00
(smtpmail-local-domain "tastytea.de")
(smtpmail-smtp-user "tastytea")
(smtpmail-stream-type 'starttls)
(smtpmail-smtp-service "submission")))
(provide 'misc/email)
;;; email.el ends here