diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-06-02 14:43:34 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-06-07 16:19:27 +0200 |
commit | 955f7683af104b98ec67ef259f0cbe4c8f2a52ed (patch) | |
tree | 61e08f711914fd25cb65ceccb5636cf74692f00c /worker/lib/testdata/message/valid/quoted-mime-type | |
parent | 8b6f9719a84fa0ee31d84b9e864495af4f166d92 (diff) | |
download | aerc-955f7683af104b98ec67ef259f0cbe4c8f2a52ed.zip |
parse: fix content-type parsing error
If an error occurs when parsing the content-type, check if the
content-type is quoted; if so, remove quotes. If this is not the case,
then return a text/plain content-type as a sane fallback option, so that
the message can be at least viewed in plaintext.
Fixes: https://todo.sr.ht/~rjarry/aerc/44
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/lib/testdata/message/valid/quoted-mime-type')
-rw-r--r-- | worker/lib/testdata/message/valid/quoted-mime-type | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/worker/lib/testdata/message/valid/quoted-mime-type b/worker/lib/testdata/message/valid/quoted-mime-type new file mode 100644 index 0000000..d9af28a --- /dev/null +++ b/worker/lib/testdata/message/valid/quoted-mime-type @@ -0,0 +1,45 @@ +Subject: Your ECOLINES tickets +X-PHP-Originating-Script: 33:functions.inc.php +From: ECOLINES <ecolines@ecolines.lv> +Content-Type: multipart/mixed; + boundary="PHP-mixed-ba319678ca12656cfb8cd46e736ce09d" +Message-Id: <E1nvIQS-0004tm-Bc@legacy.ecolines.net> +Date: Sun, 29 May 2022 15:53:44 +0300 + +--PHP-mixed-ba319678ca12656cfb8cd46e736ce09d +Content-Type: multipart/alternative; boundary="PHP-alt-ba319678ca12656cfb8cd46e736ce09d" + +--PHP-alt-ba319678ca12656cfb8cd46e736ce09d +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 7bit + +Your tickets are attached to this message. Also You can print out Your tickets from our website www.ecolines.net<b +r /> +… + +--PHP-alt-ba319678ca12656cfb8cd46e736ce09d +Content-Type: text/html; charset="UTF-8" +Content-Transfer-Encoding: 7bit + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +… + +--PHP-alt-ba319678ca12656cfb8cd46e736ce09d-- + +--PHP-mixed-ba319678ca12656cfb8cd46e736ce09d +Content-Type: "application/pdf"; name="17634428.pdf" +Content-Disposition: attachment; filename="17634428.pdf" +Content-Transfer-Encoding: base64 + +JVBERi0xLjQKMSAwIG9iago8PAovVGl0bGUgKP7/AFkAbwB1AHIAIAB0AGkAYwBrAGUAdCkKL0Ny +… + +--PHP-mixed-ba319678ca12656cfb8cd46e736ce09d +Content-Type: "application/pdf"; name="invoice-6385490.pdf" +Content-Disposition: attachment; filename="invoice-6385490.pdf" +Content-Transfer-Encoding: base64 + +JVBERi0xLjQKMSAwIG9iago8PAovVGl0bGUgKP7/AEkAbgB2AG8AaQBjAGUpCi9DcmVhdG9yICj+ +… + +--PHP-mixed-ba319678ca12656cfb8cd46e736ce09d-- |