Skip to content

Instantly share code, notes, and snippets.

@digizeph
Created March 30, 2018 20:42
Show Gist options
  • Select an option

  • Save digizeph/3f964bb36dbc2db489e48e209a020521 to your computer and use it in GitHub Desktop.

Select an option

Save digizeph/3f964bb36dbc2db489e48e209a020521 to your computer and use it in GitHub Desktop.
;;; +email.el -*- lexical-binding: t; -*-
;;
;; mail box
;;
(after! mu4e
(def-package! evil-mu4e)
(setq mu4e-maildir (expand-file-name "~/.mail/EMAIL_NAME"))
(setq mu4e-drafts-folder "/[Gmail].Drafts")
(setq mu4e-sent-folder "/[Gmail].Sent Mail")
(setq mu4e-trash-folder "/[Gmail].Trash")
;; don't save message to Sent Messages, GMail/IMAP will take care of this
;; (setq mu4e-sent-messages-behavior 'delete)
;; setup some handy shortcuts
(setq mu4e-maildir-shortcuts
'(
("/INBOX" . ?i)
("/[Gmail].Drafts" . ?d)
("/[Gmail].Sent Mail" . ?s)
("/[Gmail].All Mail" . ?a)
))
;;
;; Bookmarks
;;
(setq mu4e-bookmarks
`( ,(make-mu4e-bookmark
:name "Unread messages"
:query "flag:unread AND NOT flag:trashed"
:key ?u)
,(make-mu4e-bookmark
:name "Today's messages"
:query "date:today..now"
:key ?t)
,(make-mu4e-bookmark
:name "Last 7 days"
:query "date:7d..now"
:key ?w)
,(make-mu4e-bookmark
:name "Messages with images"
:query "mime:image/*"
:key ?p)
,(make-mu4e-bookmark
:name "SVN and Git"
:query "subject:SVN OR subject:Git"
:key ?s)
)
)
;;
;; SMTP
;;
;; alternatively, for emacs-24 you can use:
;; (use-package smtpmail)
;; (setq message-send-mail-function 'smtpmail-send-it
;; smtpmail-stream-type 'starttls
;; smtpmail-default-smtp-server "smtp.gmail.com"
;; smtpmail-smtp-server "smtp.gmail.com"
;; smtpmail-smtp-service 587)
;; something about ourselves
;; I don't use a signature...
(setq
mu4e-reply-to-address "FROM_EMAIL"
user-mail-address "FROM_EMAIL"
user-full-name "FULLNAME"
)
;;
;; Fetch emails
;;
;; allow for updating mail using 'U' in the main view:
(setq mu4e-get-mail-command "mbsync -V gmail")
;; update mu database every 2 minutes
(setq mu4e-update-interval 60)
;;
;; Read and write
;;
(setq mu4e-enable-mode-line t)
;; don't keep message buffers around
(setq message-kill-buffer-on-exit t)
;; use w3m to render html emails
(setq mu4e-html2text-command "w3m -T text/html")
;; enable inline images
(setq mu4e-view-show-images t)
;; use imagemagick, if available
(when (fboundp 'imagemagick-register-types)
(imagemagick-register-types))
;; remove signature line at the end of a sending email.
(setq mu4e-compose-signature-auto-include nil
mu4e-compose-signature "")
;; include related emails and skip duplicated headers (e.g. sent .vs all mails)
;; (setq mu4e-headers-include-related t)
(setq mue4e-headers-skip-duplicates t)
;; show address of the contacts automatically
(setq mu4e-view-show-addresses t)
;; ??
;; (add-hook 'mu4e-view-mode-hook 'visual-line-mode)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment