mutt: Add email accounts for our own domains

Switch to Migadu for our own domains. Migadu mandates
bringing your own domain for email and as such we can
now have separate mail boxes for both our .com & .net
domains. We will drop fastmail once our plan expires.

Also lots of clean up. Seems per account key binds were
broken pretty much ever since these were added.
This commit is contained in:
Sanchayan Maity 2024-10-29 11:38:43 +05:30
parent a18ada98e4
commit acaebdf0a4
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3
8 changed files with 104 additions and 97 deletions

View file

@ -1,21 +1,14 @@
# vim: syntax=muttrc
set from = "Sanchayan Maity <sanchayan@asymptotic.io>"
set sendmail = "/usr/bin/msmtp -a asymptotic"
set sendmail = "msmtp -a asymptotic"
set mbox = "+asymptotic/Archive"
set postponed = "+asymptotic/drafts"
set postponed = "+asymptotic/Drafts"
set record = "+asymptotic/Sent"
set signature = "~/.mutt/signature"
color status green default
macro index S <save-message>+asymptotic/Spam<enter>
macro index D <save-message>+asymptotic/Trash<enter>
macro index D \
"<save-message>+asymptotic/Trash<enter>" \
"move message to the trash"
macro index S \
"<save-message>+asymptotic/Spam<enter>" \
"mark message as spam"
macro index gi "<change-folder>=asymptotic/Inbox<enter>" "Go to Inbox"
macro index gs "<change-folder>=asymptotic/Sent<enter>" "Go to Sent"
macro index gi <change-folder>=asymptotic/Inbox<enter>
macro index gs <change-folder>=asymptotic/Sent<enter>

View file

@ -1,32 +1,14 @@
# vim: syntax=muttrc
set from = "Sanchayan Maity <sanchayan@sanchayanmaity.net>"
set sendmail = "/usr/bin/msmtp -a fastmail"
set from = "Sanchayan Maity <maitysanchayan@fastmail.com>"
set sendmail = "msmtp -a fastmail"
set mbox = "+fastmail/Archive"
set postponed = "+fastmail/drafts"
set postponed = "+fastmail/Drafts"
set record = "+fastmail/Sent"
set signature = "~/.mutt/signature"
color status green default
macro index D \
"<save-message>+fastmail/Trash<enter>" \
"move message to the trash"
macro index S \
"<save-message>+fastmail/Spam<enter>" \
"mark message as spam"
# Binding 'gi' will alias 'g'
bind index g noop
macro index D <save-message>+fastmail/Trash<enter>
macro index S <save-message>+fastmail/Spam<enter>
macro index gi "<change-folder>=fastmail/Inbox<enter>" "Go to Inbox"
macro index gf "<change-folder>=fastmail/FreedesktopGitlab<enter>" "Go to Freedesktop GitLab"
macro index gg "<change-folder>=fastmail/gstreamer<enter>" "Go to GStreamer"
macro index gs "<change-folder>=fastmail/Sent<enter>" "Go to Sent"
macro index ge "<change-folder>=fastmail/ietf<enter>" "Go to IETF"
macro index gc "<change-folder>=fastmail/Coffee<enter>" "Go to Coffee"
# See send-hook and patterns here http://www.mutt.org/doc/manual/#patterns
#send-hook . 'reset crypt_autoencrypt'
#send-hook '~f sanchayan@sanchayanmaity\\.net' 'set crypt_autosign'

View file

@ -1,24 +1,11 @@
# vim: syntax=muttrc
set from = "Sanchayan Maity <maitysanchayan@gmail.com>"
set sendmail = "/usr/bin/msmtp -a Sanchayan"
set sendmail = "msmtp -a Sanchayan"
set mbox = "+sanchayan/Archive"
set postponed = "+sanchayan/drafts"
set postponed = "+sanchayan/Drafts"
set record = "+sanchayan/Sent"
set signature = "~/.mutt/signature"
color status green default
macro index D \
"<save-message>+sanchayan/Trash<enter>" \
"move message to the trash"
macro index S \
"<save-message>+sanchayan/Spam<enter>" \
"mark message as spam"
macro index gi "<change-folder>=sanchayan/Inbox<enter>" "Go to Inbox"
macro index gf "<change-folder>=sanchayan/FreedesktopGitlab<enter>" "Go to freedesktop gitlab"
macro index gg "<change-folder>=sanchayan/gstreamer<enter>" "Go to gstreamer"
macro index gp "<change-folder>=sanchayan/pulseaudio<enter>" "Go to pulseaudio"
macro index gs "<change-folder>=sanchayan/Sent<enter>" "Go to Sent"
macro index S <save-message>+sanchayan/Spam<enter>
macro index D <save-message>+sanchayan/Trash<enter>

View file

@ -0,0 +1,11 @@
# vim: syntax=muttrc
set from = "Sanchayan Maity <me@sanchayanmaity.com>"
set sendmail = "msmtp -a sanchayan-com"
set mbox = "+sanchayan-com/Archive"
set postponed = "+sanchayan-com/Drafts"
set record = "+sanchayan-com/Sent"
set signature = "~/.mutt/signature"
macro index J <save-message>+sanchayan-com/Junk<enter>
macro index D <save-message>+sanchayan-com/Trash<enter>

View file

@ -0,0 +1,25 @@
# vim: syntax=muttrc
set from = "Sanchayan Maity <me@sanchayanmaity.net>"
set sendmail = "msmtp -a sanchayan-net"
set mbox = "+sanchayan-net/Archive"
set postponed = "+sanchayan-net/Drafts"
set record = "+sanchayan-net/Sent"
set signature = "~/.mutt/signature"
macro index J <save-message>+sanchayan-net/Junk<enter>
macro index D <save-message>+sanchayan-net/Trash<enter>
macro index gi <change-folder>=sanchayan-net/Inbox<enter>
macro index gf <change-folder>=sanchayan-net/FreedesktopGitlab<enter>
macro index gg <change-folder>=sanchayan-net/gstreamer<enter>
macro index gs <change-folder>=sanchayan-net/Sent<enter>
macro index ge <change-folder>=sanchayan-net/ietf<enter>
macro index gc <change-folder>=sanchayan-net/Coffee<enter>
macro index gt <change-folder>=sanchayan-net/Trash<enter>
macro index gj <change-folder>=sanchayan-net/Junk<enter>
macro index gS <change-folder>=sanchayan-net/Spam<enter>
# See send-hook and patterns here http://www.mutt.org/doc/manual/#patterns
#send-hook . 'reset crypt_autoencrypt'
#send-hook '~f sanchayan@sanchayanmaity\\.net' 'set crypt_autosign'

View file

@ -1,18 +0,0 @@
# vim: syntax=muttrc
set from = "victorascroft@gmail.com"
set sendmail = "/usr/bin/msmtp -a Victor"
set mbox = "+victor/Archive"
set postponed = "+victor/Drafts"
set record = "+victor/Sent"
set signature = "~/.mutt/signature"
color status cyan default
macro index D \
"<save-message>+victor/Trash<enter>" \
"move message to the trash"
macro index S \
"<save-message>+victor/Spam<enter>" \
"mark message as spam"

View file

@ -1,14 +1,31 @@
#!/bin/bash
# Without this pinentry-gtk does not get triggered to ask for GPG password.
export DISPLAY=:0
imapfilter -c ~/.imapfilter/config.lua
imapfilter
# find also outputs the directory itself it is given as input and since we
# count the lines in output for checking the number of mails, this gives
# a result of 1 when no mails have been received. For this, we substract 1
# a result of 1 when no mails have been received. For this, we subtract 1
# from the result of our command.
if [ -d "$HOME/Mail/sanchayan-net" ]; then
mbsync sanchayan-net
inbox=$(($(find ~/Mail/sanchayan-net/Inbox/new | wc -l)-1))
if [ "$inbox" -gt 0 ]; then
notify-send "You have $inbox new mails in sanchayanmaity.net inbox"
fi
fi
if [ -d "$HOME/Mail/sanchayan-com" ]; then
mbsync sanchayan-com
inbox=$(($(find ~/Mail/sanchayan-com/Inbox/new | wc -l)-1))
if [ "$inbox" -gt 0 ]; then
notify-send "You have $inbox new mails in sanchayanmaity.com inbox"
fi
fi
if [ -d "$HOME/Mail/fastmail" ]; then
mbsync fastmail
fastmail_inbox=$(($(find ~/Mail/fastmail/Inbox/new | wc -l)-1))
@ -36,5 +53,3 @@ if [ -d "$HOME/Mail/asymptotic" ]; then
notify-send "You have $asymptotic_inbox new mails in asymptotic inbox"
fi
fi
notmuch new

View file

@ -2,17 +2,21 @@
set mbox_type = Maildir
set folder = ~/Mail
set spoolfile = +/fastmail/Inbox
set header_cache=~/Mail/mutt_cache/ # a much faster opening of mailboxes...
set spoolfile = +/sanchayan-net/Inbox
set header_cache=~/Mail/.mutt_cache/
source ~/.mutt/gpgrc
source ~/.mutt/accounts/fastmail
source ~/.mutt/accounts/sanchayan-net
source ~/.mutt/accounts/sanchayan-com
source ~/.mutt/accounts/sanchayan
source ~/.mutt/accounts/asymptotic
source ~/.mutt/accounts/fastmail
folder-hook fastmail/* source ~/.mutt/accounts/fastmail
folder-hook sanchayan/* source ~/.mutt/accounts/sanchayan
folder-hook asymptotic/* source ~/.mutt/accounts/asymptotic
folder-hook sanchayan-net/* source ~/.mutt/accounts/sanchayan-net
folder-hook sanchayan-com/* source ~/.mutt/accounts/sanchayan-com
folder-hook sanchayan/* source ~/.mutt/accounts/sanchayan
folder-hook asymptotic/* source ~/.mutt/accounts/asymptotic
folder-hook fastmail/* source ~/.mutt/accounts/fastmail
set mail_check = 0
set envelope_from
@ -64,10 +68,6 @@ set mailcap_path = ~/.mutt/mailcap
auto_view text/html
alternative_order text/plain text/html
## Abook
set query_command= "abook --mutt-query '%s'"
macro index,pager A "<pipe-message>abook --add-email-quiet<return>"
## Add this sender to Abook
bind editor <Tab> complete-query
@ -83,9 +83,11 @@ macro index a "<limit>all\n" "show all messages (undo limit)"
bind index c noop
macro index C '<change-folder>?<change-dir><home>^K=<enter>'
macro index cn '<enter-command>source ~/.mutt/muttrc/accounts/sanchayan-net<enter><change-folder>=sanchayan-net/Inbox/<enter>'
macro index cc '<enter-command>source ~/.mutt/muttrc/accounts/sanchayan-com<enter><change-folder>=sanchayan-com/Inbox/<enter>'
macro index cg '<enter-command>source ~/.mutt/muttrc/accounts/sanchayan<enter><change-folder>=sanchayan/Inbox/<enter>'
macro index ca '<enter-command>source ~/.mutt/muttrc/accounts/asymptotic<enter><change-folder>=asymptotic/Inbox/<enter>'
macro index cf '<enter-command>source ~/.mutt/muttrc/accounts/fastmail<enter><change-folder>=fastmail/Inbox/<enter>'
macro index cg '<enter-command>source ~/.mutt/muttrc/accounts/sanchayan<enter><change-folder>=sanchayan/Inbox/<enter>'
macro index ,so "l ^a^k^O\n" "show old messages only"
macro index ,sn "l ^a^k~N\n" "show unread/new only"
@ -107,23 +109,33 @@ bind index,pager \Cp sidebar-prev
bind index,pager \Cn sidebar-next
bind index,pager \Co sidebar-open
mailboxes = +fastmail/Inbox
mailboxes = +fastmail/gstreamer
mailboxes = +fastmail/FreedesktopGitlab
mailboxes = +fastmail/pulseaudio
mailboxes = +fastmail/Sent
mailboxes = +fastmail/Spam
mailboxes = +sanchayan-net/Inbox
mailboxes = +sanchayan-net/Coffee
mailboxes = +sanchayan-net/ietf
mailboxes = +sanchayan-net/gstreamer
mailboxes = +sanchayan-net/FreedesktopGitlab
mailboxes = +sanchayan-net/Sent
mailboxes = +sanchayan-net/Spam
mailboxes = +sanchayan-net/Trash
mailboxes = +asymptotic/Inbox
mailboxes = +asymptotic/Sent
mailboxes = +sanchayan-com/Inbox
mailboxes = +sanchayan-com/Sent
mailboxes = +sanchayan-com/Spam
mailboxes = +sanchayan-com/Trash
mailboxes = +sanchayan/Inbox
mailboxes = +sanchayan/gstreamer
mailboxes = +sanchayan/FreedesktopGitlab
mailboxes = +sanchayan/pulseaudio
mailboxes = +sanchayan/Sent
mailboxes = +sanchayan/Spam
mailboxes = +asymptotic/bluez
mailboxes = +asymptotic/Inbox
mailboxes = +asymptotic/Sent
mailboxes = +asymptotic/Trash
mailboxes = +fastmail/Inbox
mailboxes = +fastmail/Sent
mailboxes = +fastmail/Spam
# GPG signing options
set crypt_autosign = "no"
set crypt_replyencrypt = "yes"