[neomutt] Add documentation to maito reply extractor

This commit is contained in:
lara 2022-10-01 18:06:23 +02:00
parent 5ee51e6ce7
commit 8c1192a148

View file

@ -4,7 +4,40 @@ set -euo pipefail
text="$(cat)"
# Extract only the text/html part of the multipart email
# The Mime Format emails we're trying to parse have the following layout
#
# To: mail@example.org
# ... <misc headers>
#
# Content-Type: multipart/mixed;
# boundary="=_c4f4c8bf54a05b2b47ef558c3c61e418"
# ...<more headers>
#
# This is a message in Mime Format. If you see this, your mail reader does not support this format.
#
# --=_c4f4c8bf54a05b2b47ef558c3c61e418
# Content-Type: multipart/alternative;
# boundary="=_935b3ef6db1361fbfde9e3eb2b1debe5"
# Content-Transfer-Encoding: 8bit
#
#
# --=_935b3ef6db1361fbfde9e3eb2b1debe5
# Content-Type: text/plain; charset=iso-8859-1
# Content-Transfer-Encoding: quoted-printable
#
# ...<text content, if any>
#
# --=_935b3ef6db1361fbfde9e3eb2b1debe5
# Content-Type: text/html; charset=iso-8859-1
# Content-Transfer-Encoding: quoted-printable
#
# <html>=0A <head>=0A <meta http-equiv=3D"Content-Type" content=3D"text/=
# html; charset=3DISO-8859-1">=09=0A <link rel=3D"stylesheet" href=3D=
# ...<and more quoted-printable html>
# ...<and misc eventual attachment parts>
# --=_c4f4c8bf54a05b2b47ef558c3c61e418--
# We're only interested in the text/html part of the multipart email
# TODO parse actual encoding instead of defaulting to iso-8859-1
mailto="$(printf "%s" "$text" \
| awk '