Start testing of mail parsing crates
This commit is contained in:
parent
8c47687d8e
commit
24d9f192e4
8 changed files with 230 additions and 183 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1366,7 +1366,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "mail-parser"
|
||||
version = "0.4.8"
|
||||
source = "git+https://github.com/superboum/mail-parser?branch=feature/no_decode#0fe5fe071f25016d9c1232eb452c0c4bbfa8a445"
|
||||
source = "git+https://github.com/superboum/mail-parser?rev=db61a03#db61a0364c00d3cf115f20c6d195bfa4594c53ff"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"serde",
|
||||
|
|
|
@ -21,7 +21,7 @@ itertools = "0.10"
|
|||
lazy_static = "1.4"
|
||||
ldap3 = { version = "0.10", default-features = false, features = ["tls"] }
|
||||
log = "0.4"
|
||||
mail-parser = { git = "https://github.com/superboum/mail-parser", branch = "feature/no_decode" }
|
||||
mail-parser = { git = "https://github.com/superboum/mail-parser", rev = "db61a03" }
|
||||
pretty_env_logger = "0.4"
|
||||
rusoto_core = "0.48.0"
|
||||
rusoto_credential = "0.48.0"
|
||||
|
|
|
@ -1,181 +0,0 @@
|
|||
use mail_parser::Message;
|
||||
|
||||
#[test]
|
||||
fn test1() {
|
||||
let input = br#"Content-Type: multipart/mixed; boundary="1234567890123456789012345678901234567890123456789012345678901234567890123456789012"
|
||||
|
||||
--1234567890123456789012345678901234567890123456789012345678901234567890123456789012
|
||||
Content-Type: multipart/mixed; boundary="123456789012345678901234567890123456789012345678901234567890123456789012345678901"
|
||||
|
||||
--123456789012345678901234567890123456789012345678901234567890123456789012345678901
|
||||
Content-Type: multipart/mixed; boundary="12345678901234567890123456789012345678901234567890123456789012345678901234567890"
|
||||
|
||||
--12345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
Content-Type: text/plain
|
||||
|
||||
1
|
||||
--1234567890123456789012345678901234567890123456789012345678901234567890123456789012
|
||||
Content-Type: text/plain
|
||||
|
||||
22
|
||||
--123456789012345678901234567890123456789012345678901234567890123456789012345678901
|
||||
Content-Type: text/plain
|
||||
|
||||
333
|
||||
--12345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
Content-Type: text/plain
|
||||
|
||||
4444
|
||||
"#;
|
||||
|
||||
let message = Message::parse(input);
|
||||
dbg!(message);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test2() {
|
||||
let input = br#"Message-ID: <39235E1C.1DC7EA90@example.com>
|
||||
Date: Wed, 17 May 2000 23:06:04 -0400
|
||||
From: Doug Sauder <dwsauder@example.com>
|
||||
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
|
||||
X-Accept-Language: en
|
||||
MIME-Version: 1.0
|
||||
To: Joe Blow <blow@example.com>
|
||||
Subject: Test message from Netscape Communicator 4.7
|
||||
Content-Type: multipart/mixed;
|
||||
boundary="------------A1FCDEE154E03D875E5D6779"
|
||||
|
||||
This is a multi-part message in MIME format.
|
||||
--------------A1FCDEE154E03D875E5D6779
|
||||
Content-Type: text/plain; charset=iso-8859-1
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
Die Hasen und die Fr=F6sche
|
||||
|
||||
Die Hasen klagten einst =FCber ihre mi=DFliche Lage; "wir leben", sprach =
|
||||
ein
|
||||
Redner, "in steter Furcht vor Menschen und Tieren, eine Beute der Hunde,
|
||||
der Adler, ja fast aller Raubtiere! Unsere stete Angst ist =E4rger als de=
|
||||
r
|
||||
Tod selbst. Auf, la=DFt uns ein f=FCr allemal sterben."
|
||||
|
||||
In einem nahen Teich wollten sie sich nun ers=E4ufen; sie eilten ihm zu;
|
||||
allein das au=DFerordentliche Get=F6se und ihre wunderbare Gestalt
|
||||
erschreckte eine Menge Fr=F6sche, die am Ufer sa=DFen, so sehr, da=DF sie=
|
||||
aufs
|
||||
schnellste untertauchten.
|
||||
|
||||
"Halt", rief nun eben dieser Sprecher, "wir wollen das Ers=E4ufen noch ei=
|
||||
n
|
||||
wenig aufschieben, denn auch uns f=FCrchten, wie ihr seht, einige Tiere,
|
||||
welche also wohl noch ungl=FCcklicher sein m=FCssen als wir."
|
||||
|
||||
|
||||
|
||||
--------------A1FCDEE154E03D875E5D6779
|
||||
Content-Type: image/png;
|
||||
name="redball.png"
|
||||
Content-Transfer-Encoding: base64
|
||||
Content-Disposition: inline;
|
||||
filename="redball.png"
|
||||
|
||||
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAABAAALAAAV
|
||||
AAAaAAAXAAARAAAKAAADAAAcAAAyAABEAABNAABIAAA9AAAjAAAWAAAmAABhAAB7AACGAACH
|
||||
AAB9AAB0AABgAAA5AAAUAAAGAAAnAABLAABvAACQAAClAAC7AAC/AACrAAChAACMAABzAABb
|
||||
AAAuAAAIAABMAAB3AACZAAC0GRnKODjVPT3bKSndBQW4AACoAAB5AAAxAAAYAAAEAABFAACa
|
||||
AAC7JCTRYWHfhITmf3/mVlbqHx/SAAC5AACjAABdAABCAAAoAAAJAABnAAC6Dw/QVFTek5Pl
|
||||
rKzpmZntZWXvJSXXAADBAACxAACcAABtAABTAAA2AAAbAAAFAABKAACBAADLICDdZ2fonJzr
|
||||
pqbtiorvUVHvFBTRAADDAAC2AAB4AABeAABAAAAiAABXAACSAADCAADaGxvoVVXseHjveHjv
|
||||
V1fvJibhAADOAAC3AACnAACVAABHAAArAAAPAACdAADFAADhBQXrKCjvPDzvNTXvGxvjAADQ
|
||||
AADJAAC1AACXAACEAABsAABPAAASAAACAABiAADpAADvAgLnAADYAADLAAC6AACwAABwAAAT
|
||||
AAAkAABYAADIAADTAADNAACzAACDAABuAAAeAAB+AADAAACkAACNAAB/AABpAABQAAAwAACR
|
||||
AACpAAC8AACqAACbAABlAABJAAAqAAAOAAA0AACsAACvAACtAACmAACJAAB6AABrAABaAAA+
|
||||
AAApAABqAACCAACfAACeAACWAACPAAB8AAAZAAAHAABVAACOAACKAAA4AAAQAAA/AAByAACA
|
||||
AABcAAA3AAAsAABmAABDAABWAAAgAAAzAAA8AAA6AAAfAAAMAAAdAAANAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8
|
||||
LtlFAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAuMT1evmgAAAII
|
||||
SURBVHicY2CAg/8QwIABmJhZWFnZ2Dk4MaU5uLh5eHn5+LkFBDlQJf8zC/EIi4iKiUtI8koJ
|
||||
Scsgyf5nlpWTV1BUUlZRVVPX4NFk1UJIyghp6+jq6RsYGhmbKJgK85mZW8Dk/rNaSlhZ29ja
|
||||
2Ts4Ojkr6Li4urFDNf53N/Ow8vTy9vH18w8IDAoWDQkNC4+ASP5ni4wKio6JjYtPSExKTnFW
|
||||
SE1LF4A69n9GZlZ2Tm5efkFhUXFySWlZlEd5RSVY7j+TkGRVdU1tXX1DY1Ozcktpa1t7h2Yn
|
||||
OAj+d7l1tyo79vT29SdNSJ44SbFVdHIo9xSIHNPUaWqTpifNSJrZnK00S0U1a/acUG5piNz/
|
||||
uXLzVJ2qm6dXz584S2WB1cJFi5cshZr539xVftnyFKUVTi2TVjqvyhJLXb1m7TqoHPt6F/HW
|
||||
0g0bN63crGqVtWXrtu07BJihcsw71+zanRW8Z89eq337RQ/Ip60xO3gIElX/LbikDm8T36Kw
|
||||
bNmRo7O3zpHkPSZwHBqL//8flz1x2OOkyKJTi7aqbzutfUZI2gIuF8F2lr/D5dw2+fZdwpl8
|
||||
YVOlI+CJ4/9/joOyYed5QzMvhGqnm2V0WiClm///D0lfXHtJ6vLlK9w7rx7vQk5SQJbFtSms
|
||||
1y9evXid7QZacgOxmSxktNzdtSwwU+J/VICaCPFIYU3XAJhIOtjf5sfyAAAAJXRFWHRDb21t
|
||||
ZW50AGNsaXAyZ2lmIHYuMC42IGJ5IFl2ZXMgUGlndWV0NnM7vAAAAABJRU5ErkJggg==
|
||||
--------------A1FCDEE154E03D875E5D6779
|
||||
Content-Type: image/png;
|
||||
name="greenball.png"
|
||||
Content-Transfer-Encoding: base64
|
||||
Content-Disposition: inline;
|
||||
filename="greenball.png"
|
||||
|
||||
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAAAEAAAGAAA
|
||||
IQAACAAAMQAAQgAAUgAAWgAASgAIYwAIcwAIewAQjAAIawAAOQAAYwAQlAAQnAAhpQAQpQAh
|
||||
rQBCvRhjxjFjxjlSxiEpzgAYvQAQrQAYrQAhvQCU1mOt1nuE1lJK3hgh1gAYxgAYtQAAKQBC
|
||||
zhDO55Te563G55SU52NS5yEh3gAYzgBS3iGc52vW75y974yE71JC7xCt73ul3nNa7ykh5wAY
|
||||
1gAx5wBS7yFr7zlK7xgp5wAp7wAx7wAIhAAQtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAp
|
||||
1fnZAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAuMT1evmgAAAFt
|
||||
SURBVHicddJtV8IgFAdwD2zIgMEE1+NcqdsoK+m5tCyz7/+ZiLmHsyzvq53zO/cy+N9ery1b
|
||||
Ve9PWQA9z4MQ+H8Yoj7GASZ95IHfaBGmLOSchyIgyOu22mgQSjUcDuNYcoGjLiLK1cHh0fHJ
|
||||
aTKKOcMItgYxT89OzsfjyTTLC8UF0c2ZNmKquJhczq6ub+YmSVUYRF59GeDastu7+9nD41Nm
|
||||
kiJ2jc2J3kAWZ9Pr55fH18XSmRuKUTXUaqHy7O19tfr4NFle/w3YDrWRUIlZrL/W86XJkyJV
|
||||
G9EaEjIx2XyZmZJGioeUaL+2AY8TY8omR6nkLKhu70zjUKVJXsp3quS2DVSJWNh3zzJKCyex
|
||||
I0ZxBP3afE0ElyqOlZJyw8r3BE2SFiJCyxA434SCkg65RhdeQBljQtCg39LWrA90RDDG1EWr
|
||||
YUO23hMANUKRRl61E529cR++D2G5LK002dr/qrcfu9u0V3bxn/XdhR/NYeeN0ggsLAAAACV0
|
||||
RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBieSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5C
|
||||
YII=
|
||||
--------------A1FCDEE154E03D875E5D6779
|
||||
Content-Type: image/png;
|
||||
name="blueball.png"
|
||||
Content-Transfer-Encoding: base64
|
||||
Content-Disposition: inline;
|
||||
filename="blueball.png"
|
||||
|
||||
iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAADAFBMVEX///8AAAgAABAAABgA
|
||||
AAAACCkAEEIAEEoACDEAEFIIIXMIKXsIKYQIIWsAGFoACDkIIWMQOZwYQqUYQq0YQrUQOaUQ
|
||||
MZQAGFIQMYwpUrU5Y8Y5Y84pWs4YSs4YQs4YQr1Ca8Z7nNacvd6Mtd5jlOcxa94hUt4YStYY
|
||||
QsYQMaUAACHO5+/n7++cxu9ShO8pWucQOa1Ke86tzt6lzu9ajO8QMZxahNat1ufO7++Mve9K
|
||||
e+8YOaUYSsaMvee15++Uve8AAClajOdzpe9rnO8IKYwxY+8pWu8IIXsAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADB
|
||||
Mg1VAAAAAXRSTlMAQObYZgAAABZ0RVh0U29mdHdhcmUAZ2lmMnBuZyAyLjAuMT1evmgAAAGI
|
||||
SURBVHicddJtV5swGAbgEk6AJhBSk4bMCUynBSLaqovbrG/bfPn/vyh70lbsscebL5xznTsh
|
||||
5BmNhgQoRChwo50EOIohUYLDj4zHhKYQkrEoQdvock4ne0IKMVUpKZLQDeqSTIsv+18PyqqW
|
||||
Uw2IBsRM7307PPp+fDJrWtnpLDJvewYxnewfnvanZ+fzpmwXijC8KbqEa3Fx2ff91Y95U9XC
|
||||
UpaDeQwiMpHXP/v+1++bWVPWQoGFawtjury9vru/f/C1Vi7ezT0WWpQHf/7+u/G71aLThK/M
|
||||
jRxmT6KdzZ9fGk9yatMsTgZLl3XVgFRAC6spj/13enssqJVtWVa3NdBSacL8+VZmYqKmdd1C
|
||||
SYoOiMOSGwtzlqqlFFIuOqv0a1ZEZrUkWICLLFW266y1KvWE1zV/iDAH1EopnVLCiygZCIom
|
||||
H3NCKX0lnI+B1iuuzCGTxwXjnDO4d7NpbX42YJJHkBwmAm2TxwAZg40J3+Xtbv1rgOAZwG0N
|
||||
xW62p+lT+Yi747sD/wEUVMzYmWkOvwAAACV0RVh0Q29tbWVudABjbGlwMmdpZiB2LjAuNiBi
|
||||
eSBZdmVzIFBpZ3VldDZzO7wAAAAASUVORK5CYII=
|
||||
--------------A1FCDEE154E03D875E5D6779--
|
||||
"#;
|
||||
|
||||
let message = Message::parse(input).unwrap();
|
||||
//dbg!(&message);
|
||||
let part = message.parts.get(0).unwrap();
|
||||
//dbg!(&part);
|
||||
let part_msg = part.parse_message().unwrap();
|
||||
}
|
1
tests/parsing-crates/.gitignore
vendored
Normal file
1
tests/parsing-crates/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
target
|
131
tests/parsing-crates/Cargo.lock
generated
Normal file
131
tests/parsing-crates/Cargo.lock
generated
Normal file
|
@ -0,0 +1,131 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "encoding_rs"
|
||||
version = "0.8.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mail-parser"
|
||||
version = "0.4.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c46a841ae5276aba5218ade7bb76896358f9f95a925c7b3deea6a0ec0fb8e2a7"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mail-parser"
|
||||
version = "0.4.8"
|
||||
source = "git+https://github.com/superboum/mail-parser?branch=feature/no_decode#0fe5fe071f25016d9c1232eb452c0c4bbfa8a445"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mail-parser"
|
||||
version = "0.4.8"
|
||||
source = "git+https://github.com/superboum/mail-parser?rev=db61a03#db61a0364c00d3cf115f20c6d195bfa4594c53ff"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mail-parser"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e25e9e9cd1360538e0ca33499f12fd180f3611d7a8e1a50b7e4e43a4c5dd4b7"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mail-parser"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/stalwartlabs/mail-parser?branch=main#bb0e3366daabec8d2f94afd22c661394f9ba7cbe"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parsing-crates"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"mail-parser 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mail-parser 0.4.8 (git+https://github.com/superboum/mail-parser?branch=feature/no_decode)",
|
||||
"mail-parser 0.4.8 (git+https://github.com/superboum/mail-parser?rev=db61a03)",
|
||||
"mail-parser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mail-parser 0.5.0 (git+https://github.com/stalwartlabs/mail-parser?branch=main)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.139"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.139"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.98"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7"
|
17
tests/parsing-crates/Cargo.toml
Normal file
17
tests/parsing-crates/Cargo.toml
Normal file
|
@ -0,0 +1,17 @@
|
|||
[package]
|
||||
name = "parsing-crates"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[[bin]]
|
||||
name = "parsing-crates-teste"
|
||||
path = "main.rs"
|
||||
|
||||
[dependencies]
|
||||
mail-parser-05 = { package = "mail-parser", version = "0.5" }
|
||||
mail-parser-048 = { package = "mail-parser", version = "0.4.8" }
|
||||
mail-parser-main = { package = "mail-parser", git = "https://github.com/stalwartlabs/mail-parser", branch = "main" }
|
||||
mail-parser-superboum = { package = "mail-parser", git = "https://github.com/superboum/mail-parser", branch = "feature/no_decode" }
|
||||
mail-parser-db61a03 = { package = "mail-parser", git = "https://github.com/superboum/mail-parser", rev = "db61a03" }
|
73
tests/parsing-crates/mail_parser.rs
Normal file
73
tests/parsing-crates/mail_parser.rs
Normal file
|
@ -0,0 +1,73 @@
|
|||
use mail_parser_superboum::Message; // FAIL
|
||||
//use mail_parser_048::Message; // PASS
|
||||
//use mail_parser_05::Message; // PASS
|
||||
//use mail_parser_main::Message; // PASS
|
||||
//use mail_parser_db61a03::Message; // PASS
|
||||
|
||||
|
||||
#[test]
|
||||
fn test1() {
|
||||
let input = br#"Content-Type: multipart/mixed; boundary="1234567890123456789012345678901234567890123456789012345678901234567890123456789012"
|
||||
|
||||
--1234567890123456789012345678901234567890123456789012345678901234567890123456789012
|
||||
Content-Type: multipart/mixed; boundary="123456789012345678901234567890123456789012345678901234567890123456789012345678901"
|
||||
|
||||
--123456789012345678901234567890123456789012345678901234567890123456789012345678901
|
||||
Content-Type: multipart/mixed; boundary="12345678901234567890123456789012345678901234567890123456789012345678901234567890"
|
||||
|
||||
--12345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
Content-Type: text/plain
|
||||
|
||||
1
|
||||
--1234567890123456789012345678901234567890123456789012345678901234567890123456789012
|
||||
Content-Type: text/plain
|
||||
|
||||
22
|
||||
--123456789012345678901234567890123456789012345678901234567890123456789012345678901
|
||||
Content-Type: text/plain
|
||||
|
||||
333
|
||||
--12345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
Content-Type: text/plain
|
||||
|
||||
4444
|
||||
"#;
|
||||
|
||||
let message = Message::parse(input);
|
||||
dbg!(message);
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn test2() {
|
||||
let input = br#"Content-Type: message/rfc822
|
||||
|
||||
Content-Type: message/rfc822
|
||||
|
||||
Content-Type: text/plain
|
||||
|
||||
1"#;
|
||||
|
||||
let message = Message::parse(input);
|
||||
dbg!(message);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test3() {
|
||||
let input = br#"Content-Type: multipart/mixed; boundary=":foo"
|
||||
|
||||
--:foo
|
||||
--:foo
|
||||
Content-Type: text/plain
|
||||
--:foo
|
||||
Content-Type: text/plain
|
||||
--:foo
|
||||
Content-Type: text/html
|
||||
--:foo--
|
||||
|
||||
|
||||
"#;
|
||||
|
||||
let message = Message::parse(input);
|
||||
dbg!(message);
|
||||
}
|
6
tests/parsing-crates/main.rs
Normal file
6
tests/parsing-crates/main.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
#[cfg(test)]
|
||||
mod mail_parser;
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
Loading…
Reference in a new issue