aboutsummaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-08-20 07:50:16 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-08-20 07:50:16 +0200
commit450c76b09a70daa6137b081ed9b7d57355d4fb80 (patch)
tree84f28b284897391cb57a17b5cc2468cbff809eac /.config
parentc097d87de7a48f34d577fc41acdfdbcf79c8197c (diff)
downloaddotfiles-450c76b09a70daa6137b081ed9b7d57355d4fb80.tar.gz
dotfiles-450c76b09a70daa6137b081ed9b7d57355d4fb80.zip
emacs: drastically simplify my email setup
Instead of having a myriad of accounts, let's set up only two of them, which are the actual ones I use on mu4e. This gets rid of hacks I did to keep some of the accounts floating, while also dropping some shenanigans like signatures which were never really relevant. With all of this off loaded from Emacs, the msmtp configuration also gets simplified, and I took the chance to tweak further some of the defaults. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to '.config')
-rw-r--r--.config/doom/config.el103
-rw-r--r--.config/doom/packages.el1
-rw-r--r--.config/msmtp/config42
3 files changed, 20 insertions, 126 deletions
diff --git a/.config/doom/config.el b/.config/doom/config.el
index f238364..9bbc491 100644
--- a/.config/doom/config.el
+++ b/.config/doom/config.el
@@ -260,15 +260,9 @@ littering will happen locally."
;; gathers all inboxes.
(add-to-list 'mu4e-bookmarks
'(:name "Inbox"
- :query "maildir:/gmail/inbox OR maildir:/comsuse/inbox OR maildir:/desuse/inbox OR maildir:/ajuntament/inbox OR maildir:/sindicat/inbox OR maildir:/uoc/inbox"
+ :query "maildir:/gmail/inbox OR maildir:/comsuse/inbox OR maildir:/sindicat/inbox OR maildir:/uoc/inbox"
:key ?n))
- ;; Things to look for when acting as a cootw.
- (add-to-list 'mu4e-bookmarks
- '(:name "COOTW"
- :query "to:scc-feedback@suse.de"
- :key ?c))
-
;; General mu4e settings.
(setq message-kill-buffer-on-exit t
mu4e-update-interval 600
@@ -285,22 +279,14 @@ littering will happen locally."
mu4e-context-policy 'ask-if-none
mu4e-compose-context-policy 'always-ask
- mu4e-change-filenames-when-moving t))
+ mu4e-change-filenames-when-moving t)
-;; Let the account party begin!
+ ;; Set the cite style just like what it is on GMail.
+ ;; NOTE: not totally sure on this one.
+ (setq message-cite-style message-cite-style-gmail
+ message-citation-line-function 'message-insert-formatted-citation-line))
-(defun mssola/mail-signature (key)
- "Return the proper mail signature for the given `KEY'."
-
- (cond
- ((string= key "pgp")
- (concat
- "Miquel Sabaté Solà,\n"
- "PGP: 4096R / 1BA5 3C7A C93D CA2A CFDF DA97 96BE 8C6F D89D 6565\n"))
- ((string= key "town")
- (concat
- "Miquel Sabaté Solà,\n"
- "Regidor de l'Ajuntament de Capellades\n"))))
+;; Let the account party begin!
(set-email-account! "gmail"
'((mu4e-sent-folder . "/gmail/Sent")
@@ -308,90 +294,27 @@ littering will happen locally."
(mu4e-trash-folder . "/gmail/Trash")
(mu4e-refile-folder . "/gmail/All")
(smtpmail-smtp-user . "mikisabate@gmail.com")
- (user-mail-address . "mikisabate@gmail.com")
- (mu4e-compose-signature . (mssola/mail-signature "pgp")))
+ (user-mail-address . "mikisabate@gmail.com"))
t)
-(set-email-account! "uoc"
- '((mu4e-sent-folder . "/uoc/Sent")
- (mu4e-drafts-folder . "/uoc/Drafts")
- (mu4e-trash-folder . "/uoc/Trash")
- (mu4e-refile-folder . "/uoc/All")
- (smtpmail-smtp-user . "mssola@uoc.edu")
- (user-mail-address . "mssola@uoc.edu")
- (mu4e-compose-signature . (mssola/mail-signature "pgp")))
- nil)
-
-(set-email-account! "ajuntament"
- '((mu4e-sent-folder . "/ajuntament/Elements enviats")
- (mu4e-drafts-folder . "/ajuntament/Esborranys")
- (mu4e-trash-folder . "/ajuntament/Elements suprimits")
- (mu4e-refile-folder . "/ajuntament/Arxiu")
- (smtpmail-smtp-user . "sabatesm@capellades.cat")
- (user-mail-address . "sabatesm@capellades.cat")
- (mu4e-compose-signature . (mssola/mail-signature "town")))
- nil)
-
-(set-email-account! "sindicat"
- '((mu4e-sent-folder . "/sindicat/inbox/Sent")
- (mu4e-drafts-folder . "/sindicat/inbox/Drafts")
- (mu4e-trash-folder . "/sindicat/inbox/Trash")
- (mu4e-refile-folder . "/sindicat/inbox/Archive")
- (smtpmail-smtp-user . "msabate@cgtsuse.org")
- (user-mail-address . "msabate@cgtsuse.org")
- (mu4e-compose-signature . (mssola/mail-signature "pgp")))
- nil)
-
(set-email-account! "comsuse"
'((mu4e-sent-folder . "/comsuse/Elements enviats")
(mu4e-drafts-folder . "/comsuse/Esborranys")
(mu4e-trash-folder . "/comsuse/Elements suprimits")
(mu4e-refile-folder . "/comsuse/Arxiu")
(smtpmail-smtp-user . "msabate@suse.com")
- (user-mail-address . "msabate@suse.com")
- (mu4e-compose-signature . (mssola/mail-signature "pgp")))
- nil)
-
-(set-email-account! "desuse"
- '((mu4e-sent-folder . "/desuse/Sent")
- (mu4e-drafts-folder . "/desuse/Drafts")
- (mu4e-trash-folder . "/desuse/Trash")
- (mu4e-refile-folder . "/desuse/Archives")
- (smtpmail-smtp-user . "msabate@suse.de")
- (user-mail-address . "msabate@suse.de")
- (mu4e-compose-signature . (mssola/mail-signature "pgp")))
+ (user-mail-address . "msabate@suse.com"))
nil)
;; My main account is properly accounted as a gmail one, but the UOC one is not.
;; Let's add it here (we need to have them all listed).
-(setq +mu4e-gmail-accounts '(("mikisabate@gmail.com" . "/gmail")
- ("mssola@uoc.edu" . "/uoc")))
+(setq +mu4e-gmail-accounts '(("mikisabate@gmail.com" . "/gmail")))
+
+;; Colorize patch-based emails
+(add-hook 'gnus-part-display-hook 'message-view-patch-highlight)
;; Last but not least, let's configure PGP with mu4e.
(setq mml-secure-openpgp-signers '("0x96BE8C6FD89D6565")
mml-secure-openpgp-sign-with-sender t)
(add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
-
-(defun mssola/clean-email-env ()
- "Clean the maildir environment."
-
- (interactive)
-
- ;; The 'ajuntament' maildir is a bit special, since I have to handle it
- ;; manually for embarrasing reasons.
- (mapc (lambda (f)
- (unless (file-directory-p f)
- (delete-file f)))
- (directory-files (concat (file-name-as-directory mssola-data-dir)
- "mail/ajuntament/inbox/new")
- t)))
-
-;; This is the only hook that `mu4e' allows us to actually do something around
-;; fetching emails. Let's clean the environment before anything, which should be
-;; fine for stupid maildirs such as 'ajuntament'.
-;;
-;; NOTE: this is only done for my workstation. For other machines this is not so
-;; relevant.
-(when (mssola/email-p)
- (add-hook 'mu4e-update-pre-hook 'mssola/clean-email-env))
diff --git a/.config/doom/packages.el b/.config/doom/packages.el
index c8ce441..c494fcc 100644
--- a/.config/doom/packages.el
+++ b/.config/doom/packages.el
@@ -4,3 +4,4 @@
(package! crux)
(package! langtool)
(package! mu4e-alert :disable t)
+(package! message-view-patch)
diff --git a/.config/msmtp/config b/.config/msmtp/config
index 8fbcdc1..ee61e2d 100644
--- a/.config/msmtp/config
+++ b/.config/msmtp/config
@@ -1,7 +1,9 @@
# Set default values for all following accounts.
defaults
-auth on
-tls on
+auth login
+tls on
+tls_certcheck off
+tls_starttls on
logfile ~/.msmtp.log
# gmail.com
@@ -9,7 +11,7 @@ account gmail
host smtp.gmail.com
port 587
from mikisabate@gmail.com
-user mikisabate
+user mikisabate@gmail.com
passwordeval "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.mbsyncpassgmail.gpg"
# suse.com
@@ -17,40 +19,8 @@ account comsuse
host smtp.gmail.com
port 587
from msabate@suse.com
-user msabate
+user msabate@suse.com
passwordeval "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.mbsyncpasssusecom.gpg"
-# suse.de
-account desuse
-host imap.suse.de
-port 587
-from msabate@imapsusede
-user msabate@imapsusede
-passwordeval "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.imapsusede.gpg"
-
-# cgtsuse.org
-account sindicat
-host cgtsuse.org
-port 587
-from msabate@cgtsuse.org
-user msabate@cgtsuse.org
-passwordeval "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.mbsyncpasssusede.gpg"
-
-# capellades.cat
-account ajuntament
-host mail.diba.cat
-port 587
-from sabatesm@capellades.cat
-user dibasp\sabatesm
-passwordeval "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.mbsyncpasssusede.gpg"
-
-# uoc.edu
-account uoc
-host smtp.gmail.com
-port 587
-from mssola@uoc.edu
-user mssola
-passwordeval "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.mbsyncpassuoc.gpg"
-
# Set a default account
account default : gmail