From 7b2b9cda8d266108c0b8bfde5bf7d6fec813041d Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Tue, 11 Jun 2024 06:57:17 +1200 Subject: [PATCH] emacs: add email config --- .emacs.d/init.el | 29 +++++++++++++++++++++++++++++ sync.sh | 1 + 2 files changed, 30 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 3444e67..3842a6d 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -270,6 +270,35 @@ One will be created if none exist." (add-hook 'after-init-hook 'dashboard-initialize) (dashboard-setup-startup-hook) +;; mu4e +(let + ((mu4e-path + (concat (getenv "HOME") "/.nix-profile/share/emacs/site-lisp/mu4e/"))) + (unless (file-exists-p mu4e-path) + (throw 'mu4e-load-path "cannot locate mu4e load path")) + (add-to-list 'load-path mu4e-path)) +(require 'mu4e) +(setq mu4e-maildir "~/mail" + mu4e-get-mail-command "mbsync -a" + mu4e-update-interval (* 5 60) ; 5 minutes + mu4e-change-filenames-when-moving t ; prevent mail syncing issues with mbsync + mu4e-refile-folder "/Archive" + mu4e-drafts-folder "/Drafts" + mu4e-sent-folder "/Sent" + mu4e-trash-folder "/Trash" + mu4e-maildir-shortcuts '(("/Inbox" . ?i) + ("/Archive" . ?a) + ("/Drafts" . ?d))) +(global-set-key (kbd "C-c m") 'mu4e) + +;; smtp +(setq message-send-mail-function 'smtpmail-send-it + user-mail-address "jeremy@baxters.nz" + user-full-name "Jeremy Baxter" + smtpmail-smtp-server "smtp.migadu.com" + smtpmail-smtp-service 465 + smtpmail-stream-type 'ssl) + ;; misc ;; guess the major mode from file name diff --git a/sync.sh b/sync.sh index d7cae31..a918d5d 100755 --- a/sync.sh +++ b/sync.sh @@ -7,6 +7,7 @@ cd "$(dirname $0)" cp "$HOME"/.gitconfig . cp "$HOME"/.gitignore . cp "$HOME"/.kshrc . +cp "$HOME"/.mbsyncrc . cp "$HOME"/.profile . mkdir -p .emacs.d/