From 1262cc02739b715913af4a554e3558d4a268ace9 Mon Sep 17 00:00:00 2001 From: hyzen Date: Thu, 14 May 2026 03:41:09 +0530 Subject: [PATCH] Update: newmail-notification --- mutt-add-account.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mutt-add-account.sh b/mutt-add-account.sh index 6468869..06485b2 100755 --- a/mutt-add-account.sh +++ b/mutt-add-account.sh @@ -613,7 +613,7 @@ EOF if [ "$is_gmail" = true ]; then # Boxes for goimapnotify (Gmail) - list of maps with per-box handlers notify_boxes_yaml=" - mailbox: \"INBOX\" - onNewMail: \"mbsync '$email' && notify-send -i mail-unread 'New Mail' '$email' && paplay /usr/share/sounds/freedesktop/stereo/message-new-instant.oga\" + onNewMail: \"mbsync '$email' && MAIL=\$(ls -t ~/Maildir/${shortname}/INBOX/cur/ | head -1) && FROM=\$(grep -m1 '^From:' ~/Maildir/${shortname}/INBOX/cur/\$MAIL | cut -c6-50) && SUBJ=\$(grep -m1 '^Subject:' ~/Maildir/${shortname}/INBOX/cur/\$MAIL | cut -c9-60) && notify-send -i mail-unread 'New Mail - $email' \"\$FROM\n\$SUBJ\" && paplay /usr/share/sounds/freedesktop/stereo/message-new-instant.oga\" onNewMailPost: \"\" onChangedMail: \"mbsync $email\" onChangedMailPost: \"\"