Compare commits

...

2 commits

Author SHA1 Message Date
ecf9bb731e
mutt: mailnotify: Drop all notifications
Getting rid of the desire to check mails immediately. May
be we should also rename this now as we only sync mails
here but it is fine for now.
2024-11-16 12:39:22 +05:30
57ef401a11
mutt: accounts: Add missing message hooks
We still will probably get mails from sanchayan@domain.
Add a message hook to select the correct account for
the same.
2024-11-16 12:39:21 +05:30
2 changed files with 7 additions and 34 deletions

View file

@ -17,8 +17,10 @@ message-hook '~t .*' 'source ~/.mutt/accounts/sanchayan-net'
folder-hook trash$ unset trash
# Add some message hooks to automatically select the proper account when replying to an email
message-hook '~t ^me@sanchayanmaity\.net$' 'source ~/.mutt/accounts/sanchayan-net'
message-hook '~t ^me@sanchayanmaity\.com$' 'source ~/.mutt/accounts/sanchayan-com'
message-hook '~t ^sanchayan@asymptotic\.io$' 'source ~/.mutt/accounts/asymptotic'
message-hook '~t ^maitysanchayan@gmail\.com$' 'source ~/.mutt/accounts/sanchayan'
message-hook '~t ^maitysanchayan@fastmail\.com$' 'source ~/.mutt/accounts/fastmail'
message-hook '~t ^sanchayan@sanchayanmaity\.net$' 'source ~/.mutt/accounts/sanchayan-net'
message-hook '~t ^sanchayan@sanchayanmaity\.com$' 'source ~/.mutt/accounts/sanchayan-com'
message-hook '~t ^me@sanchayanmaity\.net$' 'source ~/.mutt/accounts/sanchayan-net'
message-hook '~t ^me@sanchayanmaity\.com$' 'source ~/.mutt/accounts/sanchayan-com'
message-hook '~t ^sanchayan@asymptotic\.io$' 'source ~/.mutt/accounts/asymptotic'
message-hook '~t ^maitysanchayan@gmail\.com$' 'source ~/.mutt/accounts/sanchayan'
message-hook '~t ^maitysanchayan@fastmail\.com$' 'source ~/.mutt/accounts/fastmail'

View file

@ -5,51 +5,22 @@ export DISPLAY=:0
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 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))
gitlab_inbox=$(($(find ~/Mail/fastmail/FreedesktopGitlab/new | wc -l)-1))
if [ "$fastmail_inbox" -gt 0 ]; then
notify-send "You have $fastmail_inbox new mails in fastmail inbox"
fi
if [ "$gitlab_inbox" -gt 0 ]; then
notify-send "You have $gitlab_inbox new mails in fastmail gitlab inbox"
fi
fi
if [ -d "$HOME/Mail/sanchayan" ]; then
mbsync gmail
gmail_inbox=$(($(find ~/Mail/sanchayan/Inbox/new | wc -l)-1))
if [ "$gmail_inbox" -gt 0 ]; then
notify-send "You have $gmail_inbox new mails in gmail inbox"
fi
fi
if [ -d "$HOME/Mail/asymptotic" ]; then
mbsync asymptotic
asymptotic_inbox=$(($(find ~/Mail/asymptotic/Inbox/new | wc -l)-1))
if [ "$asymptotic_inbox" -gt 0 ]; then
notify-send "You have $asymptotic_inbox new mails in asymptotic inbox"
fi
fi