diff options
Diffstat (limited to 'notmuch')
-rw-r--r-- | notmuch/.config/afew/config | 12 | ||||
-rw-r--r-- | notmuch/.config/isyncrc (renamed from notmuch/.config/mbsync/mbsyncrc) | 12 | ||||
-rw-r--r-- | notmuch/.config/notmuch/default/config | 2 | ||||
-rwxr-xr-x | notmuch/.config/notmuch/default/hooks/post-insert | 6 | ||||
-rwxr-xr-x | notmuch/.config/notmuch/default/hooks/post-new | 2 | ||||
-rwxr-xr-x | notmuch/.config/notmuch/default/hooks/pre-new | 3 | ||||
-rwxr-xr-x | notmuch/.local/lib/notmuch/notmuch-notify | 47 |
7 files changed, 50 insertions, 34 deletions
diff --git a/notmuch/.config/afew/config b/notmuch/.config/afew/config index b30b220..e19a3b4 100644 --- a/notmuch/.config/afew/config +++ b/notmuch/.config/afew/config @@ -1,11 +1,23 @@ [SpamFilter] + [KillThreadsFilter] + [ListMailsFilter] + [ArchiveSentMailsFilter] sent_tag = sent + [Filter.0] message = notify query = tag:new tags_blacklist = killed;spam tags = +notify + [InboxFilter] + +[MailMover] +folders = INBOX Archive Junk +rename = True +INBOX = 'tag:spam':Junk 'NOT tag:inbox':Archive +Archive = 'tag:spam':Junk 'tag:inbox':INBOX +Junk = 'NOT tag:spam AND tag:inbox':INBOX 'NOT tag:spam':Archive diff --git a/notmuch/.config/mbsync/mbsyncrc b/notmuch/.config/isyncrc index a2501eb..bfad9cd 100644 --- a/notmuch/.config/mbsync/mbsyncrc +++ b/notmuch/.config/isyncrc @@ -6,7 +6,7 @@ IMAPAccount porkbun Host imap.porkbun.com User tobyv@tobyvin.dev PassCmd "pass tobyv@tobyvin.dev" -SSLType IMAPS +TLSType IMAPS CertificateFile /etc/ssl/certs/ca-certificates.crt IMAPStore porkbun-remote @@ -25,7 +25,7 @@ IMAPAccount gmail Host imap.gmail.com User tobyv13@gmail.com PassCmd "pass gmail" -SSLType IMAPS +TLSType IMAPS CertificateFile /etc/ssl/certs/ca-certificates.crt IMAPStore gmail-remote @@ -43,17 +43,17 @@ Patterns "INBOX" Channel gmail-drafts Far :gmail-remote:"[Gmail]/Drafts" Near :gmail-local:Drafts +Create Near Channel gmail-sent Far :gmail-remote:"[Gmail]/Sent Mail" Near :gmail-local:Sent +Create Near Channel gmail-trash Far :gmail-remote:"[Gmail]/Trash" Near :gmail-local:Trash +Create Near Group gmail -Channel gmail -Channel gmail-drafts -Channel gmail-sent -Channel gmail-trash +Channels gmail gmail-drafts gmail-sent gmail-trash diff --git a/notmuch/.config/notmuch/default/config b/notmuch/.config/notmuch/default/config index 4a70d0c..ab4b3c6 100644 --- a/notmuch/.config/notmuch/default/config +++ b/notmuch/.config/notmuch/default/config @@ -6,6 +6,6 @@ primary_email=tobyv@tobyvin.dev other_email=tobyv13@gmail.com;tovince@siue.edu; [new] tags=new -ignore=.mbsyncstate;.uidvalidity;addressbook.tsv; +ignore=.mbsyncstate;.uidvalidity;addressbook.tsv;mujmap.toml; [maildir] synchronize_flags=true diff --git a/notmuch/.config/notmuch/default/hooks/post-insert b/notmuch/.config/notmuch/default/hooks/post-insert index 8651aa4..e1cff7e 100755 --- a/notmuch/.config/notmuch/default/hooks/post-insert +++ b/notmuch/.config/notmuch/default/hooks/post-insert @@ -1,7 +1,5 @@ #!/bin/sh -for maildir in ${XDG_DATA_HOME}/mail/${MAILDIR:-*}; do - if [ -e "$maildir"/INBOX ]; then - maildir-rank-addr --maildir="$maildir"/INBOX --outputpath="$maildir"/addressbook.tsv - fi +for maildir in ${XDG_DATA_HOME}/mail/${MAILDIR:-*}/INBOX; do + maildir-rank-addr --maildir="$maildir"/INBOX --outputpath="${maildir%/INBOX}"/addressbook.tsv done diff --git a/notmuch/.config/notmuch/default/hooks/post-new b/notmuch/.config/notmuch/default/hooks/post-new index 823024c..798340f 100755 --- a/notmuch/.config/notmuch/default/hooks/post-new +++ b/notmuch/.config/notmuch/default/hooks/post-new @@ -1,4 +1,4 @@ #!/bin/sh afew -C "$XDG_CONFIG_HOME"/notmuch/default/config --tag --new -~/.local/lib/notmuch/notmuch-notify +"$HOME"/.local/lib/notmuch/notmuch-notify diff --git a/notmuch/.config/notmuch/default/hooks/pre-new b/notmuch/.config/notmuch/default/hooks/pre-new index 7ea4a68..0d5f02f 100755 --- a/notmuch/.config/notmuch/default/hooks/pre-new +++ b/notmuch/.config/notmuch/default/hooks/pre-new @@ -1,3 +1,4 @@ #!/bin/sh -mbsync -c "$XDG_CONFIG_HOME"/mbsync/mbsyncrc "${MAILDIR:--a}" +afew -C "$XDG_CONFIG_HOME"/notmuch/default/config --move-mails +mbsync "${MAILDIR:--a}" diff --git a/notmuch/.local/lib/notmuch/notmuch-notify b/notmuch/.local/lib/notmuch/notmuch-notify index bc93f09..b8a38b6 100755 --- a/notmuch/.local/lib/notmuch/notmuch-notify +++ b/notmuch/.local/lib/notmuch/notmuch-notify @@ -18,25 +18,30 @@ def notify(title, message): ) -# Workaround for bug in the notmuch module's default config resolution -if os.environ.get("NOTMUCH_CONFIG") is None: - os.environ["NOTMUCH_CONFIG"] = os.path.join( - os.environ.get( - "XDG_CONFIG_HOME", os.path.join(os.path.expanduser("~"), ".config") - ), - "notmuch", - os.environ.get("NOTMUCH_PROFILE", "default"), - "config", - ) +def main(): + # Workaround for bug in the notmuch module's default config resolution + if os.environ.get("NOTMUCH_CONFIG") is None: + os.environ["NOTMUCH_CONFIG"] = os.path.join( + os.environ.get( + "XDG_CONFIG_HOME", os.path.join(os.path.expanduser("~"), ".config") + ), + "notmuch", + os.environ.get("NOTMUCH_PROFILE", "default"), + "config", + ) -for message in ( - notmuch.Database( - mode=notmuch.Database.MODE.READ_WRITE, - ) - .create_query("tag:notify") - .search_messages() -): - print(message) - message.remove_tag("notify") - notify(message.get_header("From"), message.get_header("Subject")) - del message + for message in ( + notmuch.Database( + mode=notmuch.Database.MODE.READ_WRITE, + ) + .create_query("tag:notify") + .search_messages() + ): + print(message) + message.remove_tag("notify") + notify(message.get_header("From"), message.get_header("Subject")) + del message + + +if __name__ == "__main__": + main() |