Pārlūkot izejas kodu

fix multiline subjects and single word senders

tags/v3.1
luukvbaal pirms 5 gadiem
committed by GitHub
vecāks
revīzija
e50d51d3e5
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. +2
    -2
      bin/mailsync

+ 2
- 2
bin/mailsync Parādīt failu

@@ -29,8 +29,8 @@ syncandnotify() {
notify "$acc" "$newcount" &
for file in $new; do
# Extract subject and sender from mail.
from=$(grep "^From: " "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; $NF=""; print $0 }' | tr -d "\"\'\<\>" | sed 's/^ \(.*\) $/\1/')
subject=$(grep "^Subject: " "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/Subject: //')
from=$(grep "^From: " "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if ($NF>=3)$NF=""; print $0 }' | tr -d "\"\'\<\>" | sed 's/^ \(.*\) $/\1/')
subject=$(sed -n '/^Subject: /,/^.*:/p' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | head -n-1)
notify-send "📧$from:" "$subject" &
done
fi


Notiek ielāde…
Atcelt
Saglabāt