aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/notmuch/.config
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-05-15 20:03:30 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-05-15 20:16:37 -0500
commit5bf571df14cd2ed7cf6ca6ecadc26da53d61af06 (patch)
tree47942cf31b8fb04a35eb7cb6406117f94a5f2b77 /notmuch/.config
parent69e420c803099db126fffd3ca4bac5e396da4e1d (diff)
feat(mail): move all mail stuff inside notmuch hooks
Diffstat (limited to 'notmuch/.config')
-rw-r--r--notmuch/.config/afew/config11
-rw-r--r--notmuch/.config/environment.d/20-mail.conf1
-rw-r--r--notmuch/.config/goimapnotify/goimapnotify.conf34
-rw-r--r--notmuch/.config/maildir-rank-addr/config.toml2
-rw-r--r--notmuch/.config/mbsync/mbsyncrc59
-rw-r--r--notmuch/.config/notmuch/default/config1
-rwxr-xr-xnotmuch/.config/notmuch/default/hooks/post-insert7
-rwxr-xr-xnotmuch/.config/notmuch/default/hooks/post-new4
-rwxr-xr-xnotmuch/.config/notmuch/default/hooks/pre-new3
-rw-r--r--notmuch/.config/profile.d/50-notmuch.sh3
-rw-r--r--notmuch/.config/systemd/user/goimapnotify.service11
-rw-r--r--notmuch/.config/systemd/user/notmuch.service3
12 files changed, 137 insertions, 2 deletions
diff --git a/notmuch/.config/afew/config b/notmuch/.config/afew/config
new file mode 100644
index 0000000..b30b220
--- /dev/null
+++ b/notmuch/.config/afew/config
@@ -0,0 +1,11 @@
+[SpamFilter]
+[KillThreadsFilter]
+[ListMailsFilter]
+[ArchiveSentMailsFilter]
+sent_tag = sent
+[Filter.0]
+message = notify
+query = tag:new
+tags_blacklist = killed;spam
+tags = +notify
+[InboxFilter]
diff --git a/notmuch/.config/environment.d/20-mail.conf b/notmuch/.config/environment.d/20-mail.conf
new file mode 100644
index 0000000..1c12b82
--- /dev/null
+++ b/notmuch/.config/environment.d/20-mail.conf
@@ -0,0 +1 @@
+MAIL=$XDG_DATA_HOME/mail/porkbun/INBOX
diff --git a/notmuch/.config/goimapnotify/goimapnotify.conf b/notmuch/.config/goimapnotify/goimapnotify.conf
new file mode 100644
index 0000000..f1be213
--- /dev/null
+++ b/notmuch/.config/goimapnotify/goimapnotify.conf
@@ -0,0 +1,34 @@
+[
+ {
+ "host": "imap.porkbun.com",
+ "port": 993,
+ "tls": true,
+ "tlsOptions": {
+ "reject_unauthorized": false
+ },
+ "username": "tobyv@tobyvin.dev",
+ "passwordCmd": "pass tobyv@tobyvin.dev | head -n1",
+ "boxes": [
+ {
+ "mailbox": "INBOX",
+ "onNewMail": "MAILDIR=porkbun:INBOX notmuch new"
+ }
+ ]
+ },
+ {
+ "host": "imap.gmail.com",
+ "port": 993,
+ "tls": true,
+ "tlsOptions": {
+ "reject_unauthorized": false
+ },
+ "username": "tobyv13@gmail.com",
+ "passwordCmd": "pass gmail | head -n1",
+ "boxes": [
+ {
+ "mailbox": "INBOX",
+ "onNewMail": "MAILDIR=gmail:INBOX notmuch new"
+ }
+ ]
+ }
+]
diff --git a/notmuch/.config/maildir-rank-addr/config.toml b/notmuch/.config/maildir-rank-addr/config.toml
new file mode 100644
index 0000000..ef2b04a
--- /dev/null
+++ b/notmuch/.config/maildir-rank-addr/config.toml
@@ -0,0 +1,2 @@
+addresses = ["tobyv@tobyvin.dev", "tobyv13@gmail.com", "tovince@siue.edu"]
+template = "{{.Address}}\t{{.Name}}\t{{.NormalizedName}}"
diff --git a/notmuch/.config/mbsync/mbsyncrc b/notmuch/.config/mbsync/mbsyncrc
new file mode 100644
index 0000000..a2501eb
--- /dev/null
+++ b/notmuch/.config/mbsync/mbsyncrc
@@ -0,0 +1,59 @@
+Create Both
+Expunge Both
+SyncState *
+
+IMAPAccount porkbun
+Host imap.porkbun.com
+User tobyv@tobyvin.dev
+PassCmd "pass tobyv@tobyvin.dev"
+SSLType IMAPS
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+IMAPStore porkbun-remote
+Account porkbun
+
+MaildirStore porkbun-local
+Path ~/.local/share/mail/porkbun/
+Inbox ~/.local/share/mail/porkbun/INBOX
+
+Channel porkbun
+Far :porkbun-remote:
+Near :porkbun-local:
+Patterns *
+
+IMAPAccount gmail
+Host imap.gmail.com
+User tobyv13@gmail.com
+PassCmd "pass gmail"
+SSLType IMAPS
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+IMAPStore gmail-remote
+Account gmail
+
+MaildirStore gmail-local
+Path ~/.local/share/mail/gmail/
+Inbox ~/.local/share/mail/gmail/INBOX
+
+Channel gmail
+Far :gmail-remote:
+Near :gmail-local:
+Patterns "INBOX"
+
+Channel gmail-drafts
+Far :gmail-remote:"[Gmail]/Drafts"
+Near :gmail-local:Drafts
+
+Channel gmail-sent
+Far :gmail-remote:"[Gmail]/Sent Mail"
+Near :gmail-local:Sent
+
+Channel gmail-trash
+Far :gmail-remote:"[Gmail]/Trash"
+Near :gmail-local:Trash
+
+Group gmail
+Channel gmail
+Channel gmail-drafts
+Channel gmail-sent
+Channel gmail-trash
diff --git a/notmuch/.config/notmuch/default/config b/notmuch/.config/notmuch/default/config
index b31367a..4a70d0c 100644
--- a/notmuch/.config/notmuch/default/config
+++ b/notmuch/.config/notmuch/default/config
@@ -5,6 +5,7 @@ name=Toby Vincent
primary_email=tobyv@tobyvin.dev
other_email=tobyv13@gmail.com;tovince@siue.edu;
[new]
+tags=new
ignore=.mbsyncstate;.uidvalidity;addressbook.tsv;
[maildir]
synchronize_flags=true
diff --git a/notmuch/.config/notmuch/default/hooks/post-insert b/notmuch/.config/notmuch/default/hooks/post-insert
new file mode 100755
index 0000000..8651aa4
--- /dev/null
+++ b/notmuch/.config/notmuch/default/hooks/post-insert
@@ -0,0 +1,7 @@
+#!/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
+done
diff --git a/notmuch/.config/notmuch/default/hooks/post-new b/notmuch/.config/notmuch/default/hooks/post-new
new file mode 100755
index 0000000..3dcc977
--- /dev/null
+++ b/notmuch/.config/notmuch/default/hooks/post-new
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+afew -C "$XDG_CONFIG_HOME"/notmuch/default/config --tag --new
+~/.local/bin/notmuch-notify
diff --git a/notmuch/.config/notmuch/default/hooks/pre-new b/notmuch/.config/notmuch/default/hooks/pre-new
new file mode 100755
index 0000000..7ea4a68
--- /dev/null
+++ b/notmuch/.config/notmuch/default/hooks/pre-new
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+mbsync -c "$XDG_CONFIG_HOME"/mbsync/mbsyncrc "${MAILDIR:--a}"
diff --git a/notmuch/.config/profile.d/50-notmuch.sh b/notmuch/.config/profile.d/50-notmuch.sh
new file mode 100644
index 0000000..f6b6d77
--- /dev/null
+++ b/notmuch/.config/profile.d/50-notmuch.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+export NOTMUCH_CONFIG="$XDG_CONFIG_HOME"/notmuch/default/config
diff --git a/notmuch/.config/systemd/user/goimapnotify.service b/notmuch/.config/systemd/user/goimapnotify.service
new file mode 100644
index 0000000..6a76d4d
--- /dev/null
+++ b/notmuch/.config/systemd/user/goimapnotify.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Execute scripts on IMAP mailbox changes (new/deleted/updated messages) using IDLE, golang version.
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/goimapnotify
+Restart=always
+RestartSec=30
+
+[Install]
+WantedBy=default.target
diff --git a/notmuch/.config/systemd/user/notmuch.service b/notmuch/.config/systemd/user/notmuch.service
index fcbee89..865b3fd 100644
--- a/notmuch/.config/systemd/user/notmuch.service
+++ b/notmuch/.config/systemd/user/notmuch.service
@@ -1,11 +1,10 @@
[Unit]
Description=Mailbox indexer service
Documentation=man:notmuch(1)
-After=mbsync@.service
[Service]
Type=oneshot
ExecStart=/usr/bin/notmuch new
[Install]
-WantedBy=mbsync@.service
+WantedBy=default.target