From 5250dc6adab5961561ceec808b5bba778beecc83 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 20 Jan 2023 17:05:16 -0500 Subject: setup afew MailMover (i think) Change-Id: Ia9b38360f359f1c7234fc894fbfc8d97d426ce45 --- lib/afew.ini | 14 +++++++++----- lib/email.nix | 10 +++++++--- profiles/laptop.nix | 15 ++++++++++++--- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/lib/afew.ini b/lib/afew.ini index 86cadc9..2ea82a3 100644 --- a/lib/afew.ini +++ b/lib/afew.ini @@ -3,6 +3,15 @@ [SpamFilter] spam_tag = spam +[MailMover] +folders = INBOX Junk +# according to docs, this should be true if using mbsync +rename = True +max_age = 15 +# rules +INBOX = 'tag:spam':Junk 'NOT tag:inbox':Archive +Junk = 'NOT tag:spam AND tag:inbox':INBOX 'NOT tag:spam':Archive + [InboxFilter] # This filter looks for the List-Id header, and if it finds it, adds a tag lists @@ -46,11 +55,6 @@ message = github query = from:github.com tags = +github;-inbox -[MailMover] -folders = Important INBOX -INBOX = 'tag:flagged AND NOT tag:spam':.Important -Important = 'NOT tag:flagged':.INBOX 'tag:spam':.INBOX - [Filter.5] message = remove lists from inbox query = tag:lists AND tag:inbox diff --git a/lib/email.nix b/lib/email.nix index e874dd6..7f477e3 100644 --- a/lib/email.nix +++ b/lib/email.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: let gpgid = "D09299626FA78AF8"; @@ -48,9 +48,13 @@ in programs = { notmuch = { enable = true; - new.tags = [ "new" ]; + new.tags = [ "unread" "inbox" ]; hooks = { - postNew = "${pkgs.afew}/bin/afew -tn && ${pkgs.afew}/bin/afew -t tag:inbox"; + postNew = lib.strings.concatStringsSep " && " [ + "${pkgs.afew}/bin/afew --tag --new" + "${pkgs.afew}/bin/afew --tag tag:inbox" + "${pkgs.afew}/bin/afew --move-mail" + ]; }; extraConfig = { search = { diff --git a/profiles/laptop.nix b/profiles/laptop.nix index 3e25609..f6af7ac 100644 --- a/profiles/laptop.nix +++ b/profiles/laptop.nix @@ -118,9 +118,18 @@ services.muchsync = { remotes = { - server = { - frequency = "*:/10"; - remote.host = "dev.simatime.com"; + lithium = { + frequency = "*:0/10"; + upload = true; + remote = { + host = "dev.simatime.com"; + checkForModifiedFiles = true; + importNew = true; + }; + local = { + checkForModifiedFiles = true; + importNew = true; + }; }; }; }; -- cgit v1.2.3