Email updates

Add afew to handle new email tagging and moving archived or deleted
mail

Add more notmuch emacs config - fcc dirs based on send address, saved
searches default to tree view, better modeline icon
This commit is contained in:
Evie Litherland-Smith 2023-10-24 18:15:21 +01:00
parent 32f58021a2
commit a1f19f7565
4 changed files with 42 additions and 4 deletions

14
home/accounts/afew/config Normal file
View file

@ -0,0 +1,14 @@
[SpamFilter]
[KillThreadsFilter]
[ListMailsFilter]
[ArchiveSentMailsFilter]
[InboxFilter]
[MailMover]
folders = Proton/Inbox iCloud/Inbox Outlook/Inbox
rename = True
max_age = 15
# rules
Proton/Inbox = 'tag:archive':Proton/Archive 'tag:deleted':Proton/Trash
iCloud/Inbox = 'tag:archive':iCloud/Archive 'tag:deleted':iCloud/Trash
Outlook/Inbox = 'tag:archive':Outlook/Archive 'tag:deleted':Outlook/Trash

View file

@ -15,9 +15,19 @@
notmuch = {
enable = true;
maildir.synchronizeFlags = true;
hooks.postInsert = "${pkgs.libnotify}/bin/notify-send notmuch updated";
new.tags = [ "new" ];
hooks.postNew = ''
if [ $(${pkgs.notmuch}/bin/notmuch count is:new) -gt 0 ]; then
${pkgs.libnotify}/bin/notify-send "Notmuch Email" "Unread emails in inbox"
fi
${pkgs.afew}/bin/afew --new --tag
${pkgs.afew}/bin/afew --all --move-mail
'';
};
afew = {
enable = true;
extraConfig = builtins.readFile ./afew/config;
};
afew.enable = true;
};
services = {
mbsync = {

View file

@ -45,6 +45,7 @@
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail
message-kill-buffer-on-exit t
display-line-numbers 'relative
fill-column 80)

View file

@ -1,7 +1,20 @@
(require 'notmuch)
(notmuch-indicator-mode)
(setq notmuch-search-oldest-first nil
(setq mail-user-agent 'notmuch-user-agent
notmuch-search-oldest-first nil
notmuch-show-logo nil
notmuch-hello-thousands-separator ","
notmuch-archive-tags '("-inbox" "+archive")
notmuch-fcc-dirs '((".*@proton.me" . "Proton/Sent")
(".*@icloud.com" . "iCloud/Sent")
(".*@ukaea.uk" . "Outlook/Sent"))
notmuch-saved-searches '((:name "inbox" :query "tag:inbox" :key [105] :sort-order nil :search-type tree)
(:name "unread" :query "tag:unread" :key [117] :sort-order nil :search-type tree)
(:name "flagged" :query "tag:flagged" :key [102] :sort-order nil :search-type tree)
(:name "sent" :query "tag:sent" :key [116] :sort-order nil :search-type tree)
(:name "drafts" :query "tag:draft" :key [100] :sort-order nil :search-type tree)
(:name "all mail" :query "*" :key [97] :sort-order nil :search-type tree))
notmuch-indicator-refresh-count 60
notmuch-indicator-args '((:terms "tag:unread and tag:inbox" :label "@")))
notmuch-indicator-args '((:terms "tag:unread and tag:inbox" :label "󰮒 ")))
(provide 'custom-email-config)