;;; init-mu4e.el --- Initialize mu4e -*- lexical-binding: t -*- ;;; Commentary: ;; https://www.djcbsoftware.nl/code/mu/ ;; https://github.com/djcb/mu/tree/master/mu4e ;;; Code: (require 'mu4e) (keymap-global-set "C-S-e" #'mu4e) (setq mu4e-attachment-dir "~/pending") (setq mu4e-headers-date-format "%F") ; https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Parsing.html (setq mu4e-headers-time-format "%I:%M %p") (setq mu4e-headers-fields '((:human-date . 16) (:from . 24) (:subject . nil))) (setq mu4e-headers-thread-child-prefix '(" " . " ")) (setq mu4e-headers-thread-connection-prefix '(" " . " ")) (setq mu4e-headers-thread-first-child-prefix '(" " . " ")) (setq mu4e-headers-thread-last-child-prefix '(" " . " ")) (setq mu4e-sent-folder "/archive") (setq mu4e-split-view 'single-window) (add-to-list 'mu4e-view-actions '("remove attachments" . my-remove-attachments)) (add-hook 'mu4e-mark-execute-pre-hook (lambda (mark msg) (when (eq mark 'move) (my-remove-attachments msg)))) (add-hook 'mu4e-view-mode-hook (lambda () (setq fill-column 998) ; https://datatracker.ietf.org/doc/html/rfc5322#section-2.1.1 (visual-line-mode t))) (defun my-remove-attachments (msg) "Remove all attachments from MSG." (shell-command (format "altermime --input='%s' --removeall" (mu4e-message-field msg :path)))) (provide 'init-mu4e) ;;; init-mu4e.el ends here