mutt-wizard

fork of Luke Smiths mutt-wizard
git clone git://git.jakekoroman.com/mutt-wizard
Log | Files | Refs | README | LICENSE

commit 8d177222d6d07ada68930a64a0f7a2e320817094
parent f845e11fe281dd144311ff619cf16388a0f636e3
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Thu, 23 Sep 2021 12:59:15 -0400

don't show message info anymore

Diffstat:
Mbin/mailsync | 13+------------
Mshare/domains.csv | 1+
2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/bin/mailsync b/bin/mailsync @@ -33,7 +33,6 @@ export GPG_TTY="$(tty)" case "$(uname)" in Darwin) notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;} - messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\"" ;} ;; *) case "$(readlink -f /sbin/init)" in @@ -46,10 +45,6 @@ case "$(uname)" in export DISPLAY=$x notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." done ;} - messageinfo() { [ -n "$pgrepoutput" ] && for x in ${displays:-0:}; do - export DISPLAY=$x - notify-send --app-name="mutt-wizard" "📧$from:" "$subject" - done ;} ;; esac @@ -67,13 +62,7 @@ syncandnotify() { -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" ;; - $((newcount > 0)) ) for file in $new; do - # Extract subject and sender from mail. - from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//') - subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n 1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n') - messageinfo & - done ;; + $((newcount > 0)) ) notify "$acc" "$newcount" ;; esac } diff --git a/share/domains.csv b/share/domains.csv @@ -49,6 +49,7 @@ canaglie.net,mail.autistici.org,993,smtp.autistici.org,465 canaglie.org,mail.autistici.org,993,smtp.autistici.org,465 carleton.ca,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 cash4u.com,imap.mail.com,993,smtp.mail.com,587 +cedars.xyz,imap.cedars.xyz,993,smtp.cedars.xyz,465 ceng.metu.edu.tr,imap.ceng.metu.edu.tr,993,mailhost.ceng.metu.edu.tr,587 cheerful.com,imap.mail.com,993,smtp.mail.com,587 chef.net,imap.mail.com,993,smtp.mail.com,587