Quellcode durchsuchen

Fix notifications for mails with multiline subject

Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
pull/999/head
Jonas Dujava vor 3 Monaten
Ursprung
Commit
43eceb5536
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden GPG-Schlüssel-ID: D5CBC3FB28EFFD99
1 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen
  1. +4
    -3
      bin/mailsync

+ 4
- 3
bin/mailsync Datei anzeigen

@@ -70,9 +70,10 @@ syncandnotify() {
echo "$newcount new mail for $2."
[ -z "$MAILSYNC_MUTE" ] &&
for file in $new; do
# Extract and decode subject and sender from mail.
subject="$(sed -n "/^Subject:/ s|Subject: *|| p" "$file" |
perl -CS -MEncode -ne 'print decode("MIME-Header", $_)')"
# Extract and decode subject and sender from mail.
subject=$(awk '/^Subject: / && ++n == 1,/^.*: / && ++i == 2' "$file" | head -n-1 |
perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' |
sed 's/^Subject: //' | tr -d '\n\t')
from="$(sed -n "/^From:/ s|From: *|| p" "$file" |
perl -CS -MEncode -ne 'print decode("MIME-Header", $_)')"
from="${from% *}" ; from="${from%\"}" ; from="${from#\"}"


Laden…
Abbrechen
Speichern