From 25740f72881e91363a79607f2994ff9f6fbe67e8 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 25 Sep 2023 17:59:40 +0100 Subject: [PATCH] Email account updates Move base mail path definition Update patterns to exclude duplicate folders and hopefully speed up mbsync a bit Add an "inboxes" group for emacs to use when updating mu4e, pulls all inboxes only Temp disable mbsync systemd job --- home/accounts/email.nix | 133 ++++++++++++++++++++------------------ home/emacs/doom/config.el | 14 ++-- hosts/Ronin/home.nix | 3 + 3 files changed, 81 insertions(+), 69 deletions(-) diff --git a/home/accounts/email.nix b/home/accounts/email.nix index 74a20aff..c8b01c02 100644 --- a/home/accounts/email.nix +++ b/home/accounts/email.nix @@ -1,73 +1,82 @@ { pkgs, hostName, ... }: { - accounts.email.maildirBasePath = ".mail"; - accounts.email.accounts = let realName = "Evelyn Litherland-Smith"; - in { - proton = let - host = "127.0.0.1"; - tls.enable = false; - in rec { - inherit realName; - maildir.path = "Proton"; - imap = { - inherit host tls; - port = 1143; - }; - smtp = { - inherit host tls; - port = 1025; - }; - address = "e.litherlandsmith@proton.me"; - aliases = [ "evie@xenia.me.uk" "evie@litherlandsmith.slmail.me" ]; - passwordCommand = "${pkgs.pass}/bin/pass show Mail/Proton/${hostName}"; - primary = true; - userName = address; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - patterns = - [ "INBOX" "Archive" "Drafts" "Sent" "Spam" "Starred" "Trash" ]; - subFolders = "Verbatim"; - extraConfig.account.AuthMechs = "LOGIN"; - }; - msmtp = { - enable = true; - extraConfig = { - tls = "off"; - auth = "login"; - }; - }; - mu.enable = true; - }; - icloud = rec { - inherit realName; - maildir.path = "iCloud"; - imap.host = "imap.mail.me.com"; - smtp.host = "smtp.mail.me.com"; - address = "e.litherlandsmith@icloud.com"; - passwordCommand = "${pkgs.pass}/bin/pass show Mail/iCloud/mbsync"; - userName = address; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - subFolders = "Verbatim"; - }; - msmtp.enable = true; - mu.enable = true; - }; - }; home.packages = with pkgs; [ protonmail-bridge ]; programs = { - mbsync.enable = true; + mbsync = { + enable = true; + groups.inboxes = { + proton = [ "INBOX" ]; + icloud = [ "INBOX" ]; + }; + }; msmtp.enable = true; - # vdirsyncer = { enable = true; }; mu.enable = true; }; services.mbsync = { - enable = true; - frequency = "*-*-* *:0/15:00"; + enable = false; + frequency = "*-*-* *:0/30:00"; + }; + accounts.email = { + maildirBasePath = ".mail"; + accounts = let realName = "Evie Litherland-Smith"; + in { + proton = let + host = "127.0.0.1"; + tls.enable = false; + in rec { + inherit realName; + maildir.path = "Proton"; + imap = { + inherit host tls; + port = 1143; + }; + smtp = { + inherit host tls; + port = 1025; + }; + address = "e.litherlandsmith@proton.me"; + aliases = [ "evie@xenia.me.uk" "evie@litherlandsmith.slmail.me" ]; + passwordCommand = "${pkgs.pass}/bin/pass show Mail/Proton/${hostName}"; + primary = true; + userName = address; + mbsync = { + enable = true; + create = "both"; + expunge = "both"; + remove = "both"; + patterns = [ "*" "!All Mail" "!Spam" "!Labels" "!Starred" ]; + subFolders = "Verbatim"; + extraConfig.account.AuthMechs = "LOGIN"; + }; + msmtp = { + enable = true; + extraConfig = { + tls = "off"; + auth = "login"; + }; + }; + mu.enable = true; + }; + icloud = rec { + inherit realName; + maildir.path = "iCloud"; + imap.host = "imap.mail.me.com"; + smtp.host = "smtp.mail.me.com"; + address = "e.litherlandsmith@icloud.com"; + passwordCommand = "${pkgs.pass}/bin/pass show Mail/iCloud/mbsync"; + userName = address; + mbsync = { + enable = true; + create = "both"; + expunge = "both"; + remove = "both"; + patterns = [ "*" "!Junk" ]; + subFolders = "Verbatim"; + }; + msmtp.enable = true; + mu.enable = true; + }; + }; }; } diff --git a/home/emacs/doom/config.el b/home/emacs/doom/config.el index 0e468333..5f3d8bb0 100644 --- a/home/emacs/doom/config.el +++ b/home/emacs/doom/config.el @@ -10,7 +10,7 @@ (set-keyboard-coding-system 'utf-8) (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) -(setq user-full-name "Evelyn Litherland-Smith" +(setq user-full-name "Evie Litherland-Smith" user-mail-address "e.litherlandsmith@proton.me" doom-font (font-spec :family "FiraCode Nerd Font" :size 16 :weight 'regular) doom-theme 'catppuccin @@ -40,8 +40,8 @@ ;; mail settings (after! mu4e - (setq mu4e-get-mail-command "true" - mu4e-update-interval 60 + (setq mu4e-get-mail-command "mbsync --pull-renew inboxes" + mu4e-update-interval 300 mu4e-sent-messages-behavior 'delete mu4e-attachment-dir "~/Downloads" mu4e-change-filenames-when-moving t @@ -61,7 +61,7 @@ t) (set-email-account! "icloud.com" '((user-mail-address . "e.litherlandsmith@icloud.com") - (mu4e-sent-folder . "/iCloud/Sent Messages") + (mu4e-sent-folder . "/iCloud/Sent") (mu4e-drafts-folder . "/iCloud/Drafts") (mu4e-trash-folder . "/iCloud/Trash") (mu4e-refile-folder . "/iCloud/Archive")) @@ -82,9 +82,9 @@ :contents-sources (list (cfw:org-create-source "Green") ; org-agenda source - (cfw:ical-create-source "Personal" "~/.calendars/nextcloud/personal.ics" "Red") - (cfw:ical-create-source "Birthdays" "~/.calendars/nextcloud/contact_birthdays.ics" "Grey") - ;; (cfw:ical-create-source "UKAEA" "~/.calendars/ukaea/calendar.ics" "Blue") + (cfw:ical-create-source "Personal" "~/.calendar/nextcloud/personal.ics" "Red") + (cfw:ical-create-source "Birthdays" "~/.calendar/nextcloud/contact_birthdays.ics" "Grey") + ;; (cfw:ical-create-source "UKAEA" "~/.calendar/ukaea/calendar.ics" "Blue") ))) ;; Org-mode settings diff --git a/hosts/Ronin/home.nix b/hosts/Ronin/home.nix index ba178899..6c29ef85 100644 --- a/hosts/Ronin/home.nix +++ b/hosts/Ronin/home.nix @@ -25,6 +25,7 @@ firefox.profiles.default.settings."browser.startup.homepage" = "https://nucleus.ukaea.uk"; }; + programs.mbsync.groups.inboxes.ukaea = [ "INBOX" ]; accounts.email.accounts = { proton.primary = lib.mkForce false; ukaea = let @@ -49,6 +50,8 @@ enable = true; create = "both"; expunge = "both"; + remove = "both"; + patterns = [ "*" "!Junk" "!Snoozed" "!Sync Issues" "!Unsent Messages" ]; subFolders = "Verbatim"; extraConfig.account.AuthMechs = "LOGIN"; };