keep a map of uuid and titles

This commit is contained in:
quenousimporte 2024-04-12 13:35:39 +02:00
parent 0833fbe161
commit ba379cd452
2 changed files with 6 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
md2imap/mbox md2imap/mbox
md2imap/uidmap
md2imap/*.header md2imap/*.header
md2imap/*.imap md2imap/*.imap
md2imap/input**/* md2imap/input**/*

View File

@ -5,14 +5,17 @@ qp () {
' -- "$@" ' -- "$@"
} }
rm mbox rm mbox
rm uidmap
for f in input/*.md for f in input/*.md
do do
dos2unix "$f" dos2unix -q "$f"
f=${f##*/} f=${f##*/}
title=${f%.md} title=${f%.md}
subject=$(echo $title|qp -e) subject=$(echo $title|qp -e)
uid=$(cat /proc/sys/kernel/random/uuid) uid=$(cat /proc/sys/kernel/random/uuid)
echo $uid $title >> uidmap
cp imap-note-header "$title".header cp imap-note-header "$title".header
sed -i "s/name/$1/" "$title".header sed -i "s/name/$1/" "$title".header
sed -i "s/email/$2/" "$title".header sed -i "s/email/$2/" "$title".header