aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2016-08-24 10:46:02 +0200
committerKarel Kočí <karel.koci@nic.cz>2016-08-24 10:46:02 +0200
commit1377c7947c8996f58c0a6fa73c1a67a3703f142f (patch)
treed04868a1d24c4e095e1f2fb8c8d28afe582c80ff
parent52c55fadff6ba4cf1fb123e89424207436c68a00 (diff)
downloadmyconfigs-1377c7947c8996f58c0a6fa73c1a67a3703f142f.tar.gz
myconfigs-1377c7947c8996f58c0a6fa73c1a67a3703f142f.tar.bz2
myconfigs-1377c7947c8996f58c0a6fa73c1a67a3703f142f.zip
Update newmail-notify
-rwxr-xr-xlocal/sbin/newmail-notify7
1 files changed, 4 insertions, 3 deletions
diff --git a/local/sbin/newmail-notify b/local/sbin/newmail-notify
index 65655b4..7c6b803 100755
--- a/local/sbin/newmail-notify
+++ b/local/sbin/newmail-notify
@@ -13,9 +13,10 @@ for account in `ls`; do
echo $m
echo $m >> ~/.mail/notify-notified
if echo "$NOTIFIED" | grep "$m" >/dev/null; then continue; fi
- FROM=`grep -E "^From: " "$m" | sed 's/^From: //'`
- SUBJECT=`grep -E "^Subject: " "$m" | sed 's/^Subject: //'`
- notify-send "Email: $account" "$FROM: $SUBJECT"
+ FROM=`grep -E "^From: " "$m" | sed 's/^From: //' | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)'`
+ TO=`grep -E "^To: " "$m" | sed 's/^To: //' | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)'`
+ SUBJECT=`grep -E "^Subject: " "$m" | sed 's/^Subject: //' | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)'`
+ notify-send "$TO: $FROM" "$SUBJECT"
done
fi
cd ~/.mail