diff --git a/README.md b/README.md index d225322..ff72cb0 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ This repository contains my configuration files for the following tools: - `alacritty` - `tmux` - **Editors & CLI Tools** - - `emacs` (Doom Emacs config) + - `doom` (Doom Emacs config) - `emacs` (Custom config) - `git` - **X11 Environment** diff --git a/doom/.config/doom/config.el b/doom/.config/doom/config.el index 31ba447..92c9cc1 100644 --- a/doom/.config/doom/config.el +++ b/doom/.config/doom/config.el @@ -81,6 +81,7 @@ (add-to-list 'default-frame-alist '(fullscreen . maximized)) (after! mu4e + ;; This is set to 't' to avoid mail syncing issues when using mbsync (setq mu4e-change-filenames-when-moving t) @@ -89,20 +90,45 @@ (setq mu4e-get-mail-command "~/.config/doom/scripts/email_sync.sh") (setq mu4e-maildir "~/Maildir") - (setq mu4e-drafts-folder "/GmailAccount/[Gmail]/Bozze") - (setq mu4e-sent-folder "/GmailAccount/[Gmail]/Posta inviata") - (setq mu4e-refile-folder "/GmailAccount/[Gmail]/Tutti i messaggi") - (setq mu4e-trash-folder "/GmailAccount/[Gmail]/Cestino") - (setq user-email-address "fabio.scottodisantolo@gmail.com") - (setq user-full-name "Fabio Scotto di Santolo") + ;; Configure email accounts + (setq mu4e-contexts + (list + ;; Protonmail Account + (make-mu4e-context + :name "Protonmail" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/ProtonMailAccount" (mu4e-message-field msg :maildir)))) + :vars '((user-mail-address . "fscottodisantolo@protonmail.com") + (user-full-name . "Fabio Scotto di Santolo") + (mu4e-drafts-folder . "/ProtonMailAccount/Drafts") + (mu4e-sent-folder . "/ProtonMailAccount/Sent") + (mu4e-refile-folder . "/ProtonMailAccount/All Mail") + (mu4e-trash-folder . "/ProtonMailAccount/Trash"))) - (setq mu4e-maildir-shortcuts - '(("/GmailAccount/Inbox" . ?i) - ("/GmailAccount/[Gmail]/Posta inviata" . ?s) - ("/GmailAccount/[Gmail]/Cestino" . ?t) - ("/GmailAccount/[Gmail]/Bozze" . ?d) - ("/GmailAccount/[Gmail]/Tutti i messaggi" . ?a))) + ;; iCloud Account + (make-mu4e-context + :name "iCloud Mail" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/iCloudAccount" (mu4e-message-field msg :maildir)))) + :vars '((user-mail-address . "fscottodisantolo@icloud.com") + (user-full-name . "Fabio Scotto di Santolo") + (mu4e-drafts-folder . "/iCloudAccount/Drafts") + (mu4e-sent-folder . "/iCloudAccount/Sent Messages") + (mu4e-refile-folder . "/iCloudAccount/INBOX") + (mu4e-trash-folder . "/iCloudAccount/Junk"))))) + ;; (setq mu4e-maildir-shortcuts + ;; '(("/Inbox" . ?i) + ;; ("/ProtonMailAccount/Sent" . ?s) + ;; ("/ProtonMailAccount/Trash" . ?t) + ;; ("/ProtonMailAccount/Drafts" . ?d) + ;; ("/ProtonMailAccount/All Mail" . ?a))) + + ;; Configure SMTP client for send emails (setq sendmail-program "/usr/bin/msmtp" send-mail-function 'sendmail-send-it message-sendmail-f-is-evil t @@ -117,10 +143,18 @@ (setq elfeed-sort-order 'descending) (setq elfeed-search-filter "1-week-ago +unread") - ;; ;; Key bindings - ;; (map! :map elfeed-search-mode-map - ;; :n "d" #'elfeed-download-current-entry - ;; :n "O" #'elfeed-search-browse-url) + ;; Key bindings + (map! :map elfeed-search-mode-map + :n "d" #'elfeed-download-current-entry + :n "O" #'elfeed-search-browse-url) ;; Update hourly (run-at-time nil (* 60 60) #'elfeed-update)) + +;; PDF config +(after! pdf-tools + :defer t + :commands (pdf-loader-install) + :mode "\\.pdf\\'" + :init (pdf-loader-install) + :config (add-to-list 'revert-without-query ".pdf")) diff --git a/doom/.config/doom/scripts/email_sync.sh b/doom/.config/doom/scripts/email_sync.sh index d839c63..1b4c212 100755 --- a/doom/.config/doom/scripts/email_sync.sh +++ b/doom/.config/doom/scripts/email_sync.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -mbsync Gmail & pid1=$! +mbsync -a & pid1=$! wait $pid1 mu index diff --git a/emacs/.mbsyncrc b/emacs/.mbsyncrc index a0ac876..07eae5a 100644 --- a/emacs/.mbsyncrc +++ b/emacs/.mbsyncrc @@ -1,21 +1,47 @@ -IMAPStore Gmail-remote -Host imap.gmail.com -Port 993 -User fabio.scottodisantolo@gmail.com -PassCmd "gpg -q -d /home/fscotto/.cache/gmail1.gpg" -SSLType IMAPS -SSLVersions TLSv1.2 TLSv1.3 -CertificateFile /etc/ssl/certs/ca-certificates.crt +##################### iCloud Account ################################## +IMAPStore iCloud-remote + Host imap.mail.me.com + Port 993 + User fscottodisantolo@icloud.com + PassCmd "pass show icloud-mail" + AuthMechs * + SSLType IMAPS + SSLVersions TLSv1.2 TLSv1.3 + PipelineDepth 1 -MaildirStore Gmail-local -Path ~/Maildir/GmailAccount/ -Inbox ~/Maildir/GmailAccount/Inbox -SubFolders Verbatim +MaildirStore iCloud-local + Path ~/Maildir/iCloudAccount/ + Inbox ~/Maildir/iCloudAccount/INBOX + SubFolders Verbatim -Channel Gmail -Far :Gmail-remote: -Near :Gmail-local: -Patterns * -Create Both -Expunge Both -SyncState * +Channel iCloud + Far :iCloud-remote: + Near :iCloud-local: + Patterns * + Create Both + Expunge Both + SyncState * + +##################### Protonmail Account ################################## +IMAPStore protonmail-remote + Host 127.0.0.1 + Port 1143 + User fscottodisantolo@protonmail.com + PassCmd "pass show protonmail-bridge" + AuthMechs * + SSLType STARTTLS + PipelineDepth 1 + CertificateFile ~/.config/protonmail/bridge-v3/cert.pem + +MaildirStore protonmail-local + Path ~/Maildir/ProtonMailAccount/ + Inbox ~/Maildir/ProtonMailAccount/INBOX + SubFolders Verbatim + +Channel Protonmail + Far :protonmail-remote: + Near :protonmail-local: + Patterns * + Create Both + Expunge Both + SyncState * diff --git a/emacs/.msmtprc b/emacs/.msmtprc index 35d7603..aa4dfe5 100644 --- a/emacs/.msmtprc +++ b/emacs/.msmtprc @@ -9,22 +9,39 @@ tls on tls_trust_file /etc/ssl/certs/ca-certificates.crt logfile ~/.config/msmtp/msmtp.log -# Account Gmail -account gmail +# Account iCloud +account icloud # Host name of the SMTP server -host smtp.gmail.com +host smtp.mail.me.com -# Use the mail submission port 587 instead of the SMTP port 25. +# Use the mail submission port 587 instead of the SMTP port 25 port 587 # Envelop-from address -from fabio.scottodisantolo@gmail.com +from fscottodisantolo@icloud.com # Authentication. The password is given using one of five methods auth on -user fabio.scottodisantolo@gmail.com -passwordeval "gpg -q -d /home/fscotto/.cache/gmail1.gpg" +user fscottodisantolo@icloud.com +passwordeval "pass show icloud-mail" + +# Account Protonmail +account protonmail + +# Hostname of the Protonmail bridge +host 127.0.0.1 + +# Port of the Protonmail bridge +port 1025 + +# Envelop-from address +from fscottodisantolo@protonmail.com + +# Authentication +auth on +user fscottodisantolo@protonmail.com +passwordeval "pass show protonmail-bridge" # Set a default account -account default : gmail +account default : icloud