summaryrefslogtreecommitdiff
path: root/.emacs.d/modules/thanos-mu4e.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/modules/thanos-mu4e.el')
-rw-r--r--.emacs.d/modules/thanos-mu4e.el132
1 files changed, 0 insertions, 132 deletions
diff --git a/.emacs.d/modules/thanos-mu4e.el b/.emacs.d/modules/thanos-mu4e.el
deleted file mode 100644
index 77b2856..0000000
--- a/.emacs.d/modules/thanos-mu4e.el
+++ /dev/null
@@ -1,132 +0,0 @@
-;;; thanos-mu4e.el --- mu4e configuration -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2023 Thanos Apollo
-
-;; Author: Thanos Apollo <[email protected]>
-;; Keywords: extensions
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;; ╭━━━━┳╮╱╱╱╱╱╱╱╱╱╱╱╱╱╱╭━━━╮╱╱╱╱╱╭╮╭╮╱╱╱╱╱╱╱╱╭━━━╮
-;; ┃╭╮╭╮┃┃╱╱╱╱╱╱╱╱╱╱╱╱╱╱┃╭━╮┃╱╱╱╱╱┃┃┃┃╱╱╱╱╱╱╱╱┃╭━━╯
-;; ╰╯┃┃╰┫╰━┳━━┳━╮╭━━┳━━╮┃┃╱┃┣━━┳━━┫┃┃┃╭━━╮╱╱╱╱┃╰━━┳╮╭┳━━┳━━┳━━╮
-;; ╱╱┃┃╱┃╭╮┃╭╮┃╭╮┫╭╮┃━━┫┃╰━╯┃╭╮┃╭╮┃┃┃┃┃╭╮┃╭━━╮┃╭━━┫╰╯┃╭╮┃╭━┫━━┫
-;; ╱╱┃┃╱┃┃┃┃╭╮┃┃┃┃╰╯┣━━┃┃╭━╮┃╰╯┃╰╯┃╰┫╰┫╰╯┃╰━━╯┃╰━━┫┃┃┃╭╮┃╰━╋━━┃
-;; ╱╱╰╯╱╰╯╰┻╯╰┻╯╰┻━━┻━━╯╰╯╱╰┫╭━┻━━┻━┻━┻━━╯╱╱╱╱╰━━━┻┻┻┻╯╰┻━━┻━━╯
-;; ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱┃┃
-;; ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╰╯
-;;; Code:
-
-(require 'smtpmail)
-(require 'server)
-
-(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e/")
-(require 'mu4e)
-
-(setf mu4e-get-mail-command "mbsync -a")
-
-(when (and is-zeus (server-running-p))
- (setf mu4e-update-interval (* 10 60)))
-
-(defun set-mu4e-context (context-name full-name mail-address signature)
- "Return a mu4e context named CONTEXT-NAME with :match-func matching
- folder name CONTEXT-NAME in Maildir. The context's `user-mail-address',
- `user-full-name' and `mu4e-compose-signature'`smtpmail-smpt-server' is set to MAIL-ADDRESS
- FULL-NAME SIGNATURE and SERVER respectively.
- Special folders are set to context specific folders."
- (let ((dir-name (concat "/" context-name)))
- (make-mu4e-context
- :name context-name
- ;; we match based on the maildir of the message
- :match-func
- `(lambda (msg)
- (when msg
- (string-match-p
- ,(concat "^" dir-name)
- (mu4e-message-field msg :maildir))))
- :vars
- `((user-mail-address . ,mail-address)
- (user-full-name . ,full-name)
- (mu4e-sent-folder . ,(concat dir-name "/Sent"))
- (mu4e-drafts-folder . ,(concat dir-name "/Drafts"))
- (mu4e-trash-folder . ,(concat dir-name "/Trash"))
- (mu4e-trash-folder . ,(concat dir-name "/Starred"))
- (mu4e-refile-folder . ,(concat dir-name "/Archive"))
- (mu4e-compose-signature . ,signature)))))
-;;Fixing duplicate UID errors when using mbsync and mu4e
-(setf mu4e-change-filenames-when-moving t)
-
-(setf mu4e-maildir-shortcuts
- '(("/Fastmail/Inbox" . ?i)
- ("/Drafts" . ?d)
- ("/Sent" . ?s)
- ("/Fastmail/Emacs/dev" . ?e)
- ("/MUSofia/[Gmail]/All Mail" . ?u)
- ("/Fastmail/Gentoo" . ?g)))
-
-(setf mu4e-contexts
- (list
- (make-mu4e-context
- :name "Public"
- :match-func
- (lambda (msg)
- (when msg
- (string-prefix-p "/Fastmail" (mu4e-message-field msg :maildir))))
- :vars '((user-mail-address . "[email protected]")
- (user-full-name . "Thanos Apollo")
- (smtpmail-smtp-server . "smtp.fastmail.com")
- (smtpmail-smtp-service . 465)
- (smtpmail-stream-type . ssl)
- (mu4e-drafts-folder . "/Drafts")
- (mu4e-sent-folder . "/Sent")
- (mu4e-refile-folder . "/Archive")
- (mu4e-trash-folder . "/Trash")))
- (make-mu4e-context
- :name "MUSofia"
- :match-func
- (lambda (msg)
- (when msg
- (string-prefix-p "/MUSofia" (mu4e-message-field msg :maildir))))
- :vars '((user-mail-address . "[email protected]")
- (user-full-name . "Thanos Apollo")
- (smtpmail-smtp-server . "smtp.gmail.com")
- (smtpmail-smtp-service . 465)
- (smtpmail-stream-type . ssl)))))
-
-(setf message-send-mail-function 'smtpmail-send-it
- mu4e-compose-signature "\nThanos Apollo\n \nhttps://thanosapollo.org\n
-62B7 58D0 F671 9938 BC09 CECA 339F 736C 3A72 0928\n"
- mu4e-compose-context-policy 'ask)
-
-(setf mu4e-view-actions
- (delete-dups
- (append
- '(("gapply git patches" . mu4e-action-git-apply-patch)
- ("mgit am patch" . mu4e-action-git-apply-mbox)
- ("bb4 am patch" . mu4e-action-git-apply-b4)
- ("ssetup reword list with b4" . mu4e-action-setup-reword-b4)
- ("crun checkpatch script" . my-mu4e-action-run-check-patch)
- ("MCheck if merged" . my-mu4e-action-check-if-merged)))))
-
-(add-hook 'mu4e-main-mode-hook #'(lambda ()
- (display-line-numbers-mode -1)
- (auto-save-mode -1)))
-;; Sign messages
-(add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
-
-(define-key global-map (kbd "C-x m") 'mu4e)
-
-(provide 'thanos-mu4e)
-;;; thanos-mu4e.el ends here