fix encoding

This commit is contained in:
quenousimporte 2024-04-10 17:10:27 +02:00
parent cfc5688c45
commit bc452a9f64
2 changed files with 10 additions and 4 deletions

View File

@ -6,7 +6,6 @@ Content-Type: text/plain; charset="utf-8"
Date: Wed, 10 Apr 2024 02:45:21 -0400
Reply-To: name <email>
X-Uniform-Type-Identifier: com.apple.mail-note
Subject: title
Subject: =?UTF-8?Q?title?=
X-Universally-Unique-Identifier: uid
Status: RO

View File

@ -1,17 +1,24 @@
qp () {
perl -MMIME::QuotedPrint -s -ne '
BEGIN { *e = $d ? \&decode_qp : \&encode_qp }
print e $_
' -- "$@"
}
rm mbox
for f in input/*.md
do
f=${f##*/}
title=${f%.md}
subject=$(echo $title|qp -e)
uid=$(cat /proc/sys/kernel/random/uuid)
cp imap-note-header "$title".imap
sed -i "s/uid/${uid}/" "$title".imap
sed -i "s/title/${title}/" "$title".imap
sed -i "s/title/${subject}/" "$title".imap
sed -i "s/name/$1/" "$title".imap
sed -i "s/email/$2/" "$title".imap
cat "input/$f" >> "$title".imap
cat "input/$f" | qp -e >> "$title".imap
cat "$title".imap >> mbox
printf '\n\n' >> mbox
rm "$title".imap