Browse Source

don't show message info anymore

tags/v3.3
Luke Smith 2 years ago
parent
commit
8d177222d6
No known key found for this signature in database GPG Key ID: 4C50B54A911F6252
2 changed files with 2 additions and 12 deletions
  1. +1
    -12
      bin/mailsync
  2. +1
    -0
      share/domains.csv

+ 1
- 12
bin/mailsync View File

@@ -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
}



+ 1
- 0
share/domains.csv View File

@@ -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


Loading…
Cancel
Save