From 57088312fdd8e602a084bd5736a0e22a34be9ec0 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Tue, 17 Oct 2023 14:40:08 +0200 Subject: worker: move shared code to lib Avoid importing code from worker/lib into lib. It should only be the other way around. Move the message parsing code used by maildir, notmuch, mbox and the eml viewer into a lib/rfc822 package. Adapt imports accordingly. Signed-off-by: Robin Jarry Reviewed-by: Koni Marti Tested-by: Moritz Poldrack Tested-by: Inwit --- lib/rfc822/testdata/message/invalid/hexa | 26 +++++++++++++ lib/rfc822/testdata/message/valid/quoted-mime-type | 45 ++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 lib/rfc822/testdata/message/invalid/hexa create mode 100644 lib/rfc822/testdata/message/valid/quoted-mime-type (limited to 'lib/rfc822/testdata/message') diff --git a/lib/rfc822/testdata/message/invalid/hexa b/lib/rfc822/testdata/message/invalid/hexa new file mode 100644 index 00000000..56b352ff --- /dev/null +++ b/lib/rfc822/testdata/message/invalid/hexa @@ -0,0 +1,26 @@ +Subject: Confirmation Needed gUdVJQBhsd +Content-Type: multipart/mixed; boundary="Nextpart_1Q2YJhd197991794467076Pgfa" +To: +From: ""REGISTRAR"" + +--Nextpart_1Q2YJhd197991794467076Pgfa +Content-Type: multipart/parallel; boundary="sg54sd54g54sdg54" + +--sg54sd54g54sdg54 +Content-Type: multipart/alternative; boundary="54qgf54q546f46qsf46qsf" + +--54qgf54q546f46qsf46qsf +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: Hexa + + + +--54qgf54q546f46qsf46qsf +Content-Type: text/html; charset=utf-8 + + +

Congratulations Netflix Customer!


+ + + +--Nextpart_1Q2YJhd197991794467076Pgfa-- diff --git a/lib/rfc822/testdata/message/valid/quoted-mime-type b/lib/rfc822/testdata/message/valid/quoted-mime-type new file mode 100644 index 00000000..d9af28a2 --- /dev/null +++ b/lib/rfc822/testdata/message/valid/quoted-mime-type @@ -0,0 +1,45 @@ +Subject: Your ECOLINES tickets +X-PHP-Originating-Script: 33:functions.inc.php +From: ECOLINES +Content-Type: multipart/mixed; + boundary="PHP-mixed-ba319678ca12656cfb8cd46e736ce09d" +Message-Id: +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 +… + +--PHP-alt-ba319678ca12656cfb8cd46e736ce09d +Content-Type: text/html; charset="UTF-8" +Content-Transfer-Encoding: 7bit + + +… + +--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-- -- cgit