From 05b651d081900b1630c4a142e73d486c623b7422 Mon Sep 17 00:00:00 2001 From: sdoering01 <57443123+sdoering01@users.noreply.github.com> Date: Wed, 30 Jun 2021 13:11:36 +0200 Subject: [PATCH] Add option to get notifications for non-standard mailboxes --- bin/mailsync | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/mailsync b/bin/mailsync index f00baf1..0a74069 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -57,7 +57,8 @@ esac syncandnotify() { acc="$(echo "$account" | sed "s/.*\///")" if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi - new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2> /dev/null) + boxes="INBOX|Inbox|inbox$(sed -E 's/^(.+)/\|\1/' "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/notification_inboxes" 2> /dev/null | tr -d '\n')" + new=$(find "$HOME/.local/share/mail/$acc" -regextype posix-egrep -regex ".*($boxes)/new.*" -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) case 1 in $((newcount > 5)) ) notify "$acc" "$newcount" ;;