diff options
author | Karel Kočí <karel.koci@nic.cz> | 2016-08-24 10:46:02 +0200 |
---|---|---|
committer | Karel Kočí <karel.koci@nic.cz> | 2016-08-24 10:46:02 +0200 |
commit | 1377c7947c8996f58c0a6fa73c1a67a3703f142f (patch) | |
tree | d04868a1d24c4e095e1f2fb8c8d28afe582c80ff /local/sbin | |
parent | 52c55fadff6ba4cf1fb123e89424207436c68a00 (diff) | |
download | myconfigs-1377c7947c8996f58c0a6fa73c1a67a3703f142f.tar.gz myconfigs-1377c7947c8996f58c0a6fa73c1a67a3703f142f.tar.bz2 myconfigs-1377c7947c8996f58c0a6fa73c1a67a3703f142f.zip |
Update newmail-notify
Diffstat (limited to 'local/sbin')
-rwxr-xr-x | local/sbin/newmail-notify | 7 |
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 |