aboutsummaryrefslogtreecommitdiff
path: root/email
diff options
context:
space:
mode:
authorMohammad Reza Karimi <m.r.karimi.j@gmail.com>2026-01-18 01:33:29 -0500
committerMohammad Reza Karimi <m.r.karimi.j@gmail.com>2026-01-18 01:33:29 -0500
commit4052357e021085bc1c761108446ee09a778ade15 (patch)
treee8664f34056a9f34538e1abb0b3eead15ecb4d70 /email
parent83113fff46023d6cde0c2d982978fe7f5a5cfce2 (diff)
big updates
Diffstat (limited to 'email')
-rw-r--r--email/dot-config/imapnotify/gmail.yaml15
-rw-r--r--email/dot-config/imapnotify/mit.yaml2
-rw-r--r--email/dot-config/isyncrc43
-rw-r--r--email/dot-config/maildir-rank-addr/config11
-rw-r--r--email/dot-config/msmtp/config19
-rw-r--r--email/dot-config/notmuch/default/config23
-rwxr-xr-xemail/dot-config/notmuch/default/hooks/post-new18
-rw-r--r--email/dot-config/oama/config.yaml3
-rw-r--r--email/dot-config/systemd/user/goimap@.service (renamed from email/dot-config/systemd/user/goimap.service)2
9 files changed, 103 insertions, 33 deletions
diff --git a/email/dot-config/imapnotify/gmail.yaml b/email/dot-config/imapnotify/gmail.yaml
new file mode 100644
index 0000000..20cc4a0
--- /dev/null
+++ b/email/dot-config/imapnotify/gmail.yaml
@@ -0,0 +1,15 @@
+configurations:
+ -
+ host: imap.gmail.com
+ port: 993
+ tls: true
+ tlsOptions:
+ rejectUnauthorized: false
+ starttls: false
+ username: m.r.karimi.j@gmail.com
+ passwordCmd: 'pass api-keys/google-app-password'
+ onNewMail: 'mailsync m.r.karimi.j@gmail.com'
+ onNewMailPost: SKIP
+ boxes:
+ -
+ mailbox: INBOX
diff --git a/email/dot-config/imapnotify/mit.yaml b/email/dot-config/imapnotify/mit.yaml
index 6aabeae..d850ba0 100644
--- a/email/dot-config/imapnotify/mit.yaml
+++ b/email/dot-config/imapnotify/mit.yaml
@@ -9,7 +9,7 @@ configurations:
xoAuth2: true
username: moreka@mit.edu
passwordCmd: 'oama access moreka@mit.edu'
- onNewMail: 'mailsync'
+ onNewMail: 'mailsync mit'
onNewMailPost: SKIP
boxes:
-
diff --git a/email/dot-config/isyncrc b/email/dot-config/isyncrc
index e57ece5..58b4af2 100644
--- a/email/dot-config/isyncrc
+++ b/email/dot-config/isyncrc
@@ -48,3 +48,46 @@ Channel sync-mit-default
Channel sync-mit-sent
Channel sync-mit-deleted
Channel sync-mit-junk
+
+IMAPAccount gmail-mrkarimij
+Host imap.gmail.com
+User m.r.karimi.j@gmail.com
+PassCmd "oama access m.r.karimi.j@gmail.com"
+TLSType IMAPS
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+Timeout 360
+
+IMAPStore gmail-mrkarimij-remote
+Account gmail-mrkarimij
+
+MaildirStore gmail-mrkarimij-local
+SubFolders Verbatim
+Path /home/moreka/.local/share/mail/m.r.karimi.j@gmail.com/
+Inbox /home/moreka/.local/share/mail/m.r.karimi.j@gmail.com/INBOX
+
+Channel gmail-mrkarimij-inbox
+Far :gmail-mrkarimij-remote:INBOX
+Near :gmail-mrkarimij-local:INBOX
+Create Near
+Expunge Both
+SyncState *
+ExpireUnread no
+
+Channel gmail-mrkarimij-sent
+Far :gmail-mrkarimij-remote:"[Gmail]/Sent Mail"
+Near :gmail-mrkarimij-local:Sent
+Create Near
+Expunge Both
+SyncState *
+
+Channel gmail-mrkarimij-drafts
+Far :gmail-mrkarimij-remote:"[Gmail]/Drafts"
+Near :gmail-mrkarimij-local:Drafts
+Create Near
+Expunge Both
+SyncState *
+
+Group m.r.karimi.j@gmail.com
+Channel gmail-mrkarimij-inbox
+Channel gmail-mrkarimij-sent
+Channel gmail-mrkarimij-drafts
diff --git a/email/dot-config/maildir-rank-addr/config b/email/dot-config/maildir-rank-addr/config
new file mode 100644
index 0000000..0ba5932
--- /dev/null
+++ b/email/dot-config/maildir-rank-addr/config
@@ -0,0 +1,11 @@
+# vim: ft=toml
+maildir = "~/.local/share/mail/mit"
+addresses = [
+ "moreka@mit.edu",
+ "moreka@MIT.EDU",
+ "m.r.karimi.j@gmail.com",
+]
+addr-book-cmd = "khard email -p --remove-first-line"
+addr-book-add-unmatched = true
+outputpath = "~/.cache/maildir-rank-addr/addressbook.tsv"
+template = "{{.Address}}\t{{.Name}}\t{{.NormalizedName}}"
diff --git a/email/dot-config/msmtp/config b/email/dot-config/msmtp/config
index e000852..02f21e4 100644
--- a/email/dot-config/msmtp/config
+++ b/email/dot-config/msmtp/config
@@ -1,14 +1,25 @@
defaults
-auth on
+
tls on
-tls_starttls off
+logfile ~/.cache/msmtp.log
account mit
host outgoing.mit.edu
port 465
+tls_starttls off
+auth on
from moreka@mit.edu
user moreka
-passwordeval "pass show mail/smtp"
-logfile ~/.cache/msmtp.log
+passwordeval pass show mail/smtp
+
+account gmail
+host smtp.gmail.com
+port 587
+auth oauthbearer
+tls_starttls on
+from m.r.karimi.j@gmail.com
+user m.r.karimi.j@gmail.com
+passwordeval oama access m.r.karimi.j@gmail.com
+tls_trust_file /etc/ssl/certs/ca-certificates.crt
account default : mit
diff --git a/email/dot-config/notmuch/default/config b/email/dot-config/notmuch/default/config
index eeacdcc..bfdbf65 100644
--- a/email/dot-config/notmuch/default/config
+++ b/email/dot-config/notmuch/default/config
@@ -6,33 +6,12 @@ name=Mohammad Reza Karimi
primary_email=moreka@mit.edu
[new]
-tags=new
+tags=inbox;unread;
ignore=.mbsyncstate;.uidvalidity;.mbsyncstate.new;.mbsyncstate.lock
[search]
exclude_tags=deleted;spam
-# Maildir compatibility configuration
-#
-# The following option is supported here:
-#
-# synchronize_flags Valid values are true and false.
-#
-# If true, then the following maildir flags (in message filenames)
-# will be synchronized with the corresponding notmuch tags:
-#
-# Flag Tag
-# ---- -------
-# D draft
-# F flagged
-# P passed
-# R replied
-# S unread (added when 'S' flag is not present)
-#
-# The "notmuch new" command will notice flag changes in filenames
-# and update tags, while the "notmuch tag" and "notmuch restore"
-# commands will notice tag changes and update flags in filenames
-
[maildir]
synchronize_flags=true
diff --git a/email/dot-config/notmuch/default/hooks/post-new b/email/dot-config/notmuch/default/hooks/post-new
index 063888b..f03a5d1 100755
--- a/email/dot-config/notmuch/default/hooks/post-new
+++ b/email/dot-config/notmuch/default/hooks/post-new
@@ -1,10 +1,18 @@
#!/bin/sh
-# remove "unread" from "replied"
-notmuch tag -unread -new -- tag:replied
+# tag emails in the Deleted folder as deleted
+notmuch tag +deleted -unread -inbox -- folder:mit/Deleted
+
+# tag emails in the Deleted folder as deleted
+notmuch tag +archived -unread -inbox -- folder:mit/Archive
-# tag all "new" messages "inbox" and "unread"
-notmuch tag +inbox +unread -new -- '(tag:new and folder:mit/INBOX)'
+# tag emails in the Deleted folder as deleted
+notmuch tag +sent -unread -inbox -- folder:mit/Sent
+notmuch tag +sent -unread -inbox -- folder:m.r.karimi.j@gmail.com/Sent
+
+# remove "unread" from "replied"
+notmuch tag -unread -- tag:replied
# tag my replies as "sent"
-notmuch tag -new -unread +sent -- '(from:"moreka@mit.edu*" not to:"moreka@mit.edu*" not tag:archived)'
+notmuch tag -unread +sent -- '(from:"moreka@mit.edu*" not to:"moreka@mit.edu*" not to:"moreka@MIT.EDU*" not tag:archived)'
+notmuch tag -unread +sent -- '(from:"m.r.karimi.j@gmail.com*" not to:"m.r.karimi.j@gmail.com*" not tag:archived)'
diff --git a/email/dot-config/oama/config.yaml b/email/dot-config/oama/config.yaml
index 7f68064..2b5ceb2 100644
--- a/email/dot-config/oama/config.yaml
+++ b/email/dot-config/oama/config.yaml
@@ -13,3 +13,6 @@ services:
microsoft:
client_id: 9e5f94bc-e8a4-4e73-b8be-63364c29d753
tenant: common
+ google:
+ client_id_cmd: pass show google/oauth/clientid
+ client_secret_cmd: pass show google/oauth/clientsecret
diff --git a/email/dot-config/systemd/user/goimap.service b/email/dot-config/systemd/user/goimap@.service
index e908999..157af79 100644
--- a/email/dot-config/systemd/user/goimap.service
+++ b/email/dot-config/systemd/user/goimap@.service
@@ -7,7 +7,7 @@ After=network-online.target
[Service]
Type=simple
-ExecStart=/usr/bin/goimapnotify -conf %h/.config/imapnotify/mit.yaml
+ExecStart=/usr/bin/goimapnotify -conf %h/.config/imapnotify/%i.yaml
Restart=always
RestartSec=300