-
Notifications
You must be signed in to change notification settings - Fork 4
/
parser_test.go
328 lines (287 loc) · 15.6 KB
/
parser_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
package gomime
import (
"bytes"
"io/ioutil"
"net/mail"
"net/textproto"
"strings"
"testing"
)
func minimalParse(mimeBody string) (readBody string, plainContents string, err error) {
mm, err := mail.ReadMessage(strings.NewReader(mimeBody))
if err != nil {
return
}
h := textproto.MIMEHeader(mm.Header)
mmBodyData, err := ioutil.ReadAll(mm.Body)
if err != nil {
return
}
printAccepter := NewMIMEPrinter()
plainTextCollector := NewPlainTextCollector(printAccepter)
visitor := NewMimeVisitor(plainTextCollector)
err = VisitAll(bytes.NewReader(mmBodyData), h, visitor)
readBody = printAccepter.String()
plainContents = plainTextCollector.GetPlainText()
return readBody, plainContents, err
}
func androidParse(mimeBody string) (body, headers string, atts, attHeaders []string, err error) {
mm, err := mail.ReadMessage(strings.NewReader(mimeBody))
if err != nil {
return
}
h := textproto.MIMEHeader(mm.Header)
mmBodyData, err := ioutil.ReadAll(mm.Body)
printAccepter := NewMIMEPrinter()
bodyCollector := NewBodyCollector(printAccepter)
attachmentsCollector := NewAttachmentsCollector(bodyCollector)
mimeVisitor := NewMimeVisitor(attachmentsCollector)
err = VisitAll(bytes.NewReader(mmBodyData), h, mimeVisitor)
body, _ = bodyCollector.GetBody()
headers = bodyCollector.GetHeaders()
atts = attachmentsCollector.GetAttachments()
attHeaders = attachmentsCollector.GetAttHeaders()
return
}
func TestParseBoundaryIsEmpty(t *testing.T) {
testMessage :=
`Date: Sun, 10 Mar 2019 11:10:06 -0600
In-Reply-To: <abcbase64@protonmail.com>
X-Original-To: enterprise@protonmail.com
References: <abc64@unicoderns.com> <abc63@protonmail.com> <abc64@protonmail.com> <abc65@mail.gmail.com> <abc66@protonmail.com>
To: "ProtonMail" <enterprise@protonmail.com>
X-Pm-Origin: external
Delivered-To: enterprise@protonmail.com
Content-Type: multipart/mixed; boundary=ac7e36bd45425e70b4dab2128f34172e4dc3f9ff2eeb47e909267d4252794ec7
Reply-To: XYZ <xyz@xyz.com>
Mime-Version: 1.0
Subject: Encrypted Message
Return-Path: <xyz@xyz.com>
From: XYZ <xyz@xyz.com>
X-Pm-Conversationid-Id: gNX9bDPLmBgFZ-C3Tdlb628cas1Xl0m4dql5nsWzQAEI-WQv0ytfwPR4-PWELEK0_87XuFOgetc239Y0pjPYHQ==
X-Pm-Date: Sun, 10 Mar 2019 18:10:06 +0100
Message-Id: <68c11e46-e611-d9e4-edc1-5ec96bac77cc@unicoderns.com>
X-Pm-Transfer-Encryption: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
X-Pm-External-Id: <68c11e46-e611-d9e4-edc1-5ec96bac77cc@unicoderns.com>
X-Pm-Internal-Id: _iJ8ETxcqXTSK8IzCn0qFpMUTwvRf-xJUtldRA1f6yHdmXjXzKleG3F_NLjZL3FvIWVHoItTxOuuVXcukwwW3g==
Openpgp: preference=signencrypt
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0
X-Pm-Content-Encryption: end-to-end
--ac7e36bd45425e70b4dab2128f34172e4dc3f9ff2eeb47e909267d4252794ec7
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: multipart/mixed; charset=utf-8
Content-Type: multipart/mixed; boundary="xnAIW3Turb9YQZ2rXc2ZGZH45WepHIZyy";
protected-headers="v1"
From: XYZ <xyz@xyz.com>
To: "ProtonMail" <enterprise@protonmail.com>
Subject: Encrypted Message
Message-ID: <68c11e46-e611-d9e4-edc1-5ec96bac77cc@unicoderns.com>
References: <abc64@unicoderns.com> <abc63@protonmail.com> <abc64@protonmail.com> <abc65@mail.gmail.com> <abc66@protonmail.com>
In-Reply-To: <abcbase64@protonmail.com>
--xnAIW3Turb9YQZ2rXc2ZGZH45WepHIZyy
Content-Type: text/rfc822-headers; protected-headers="v1"
Content-Disposition: inline
From: XYZ <xyz@xyz.com>
To: ProtonMail <enterprise@protonmail.com>
Subject: Re: Encrypted Message
--xnAIW3Turb9YQZ2rXc2ZGZH45WepHIZyy
Content-Type: multipart/alternative;
boundary="------------F9E5AA6D49692F51484075E3"
Content-Language: en-US
This is a multi-part message in MIME format.
--------------F9E5AA6D49692F51484075E3
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi ...
--------------F9E5AA6D49692F51484075E3
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html>
<head>
</head>
<body text=3D"#000000" bgcolor=3D"#FFFFFF">
<p>Hi .. </p>
</body>
</html>
--------------F9E5AA6D49692F51484075E3--
--xnAIW3Turb9YQZ2rXc2ZGZH45WepHIZyy--
--ac7e36bd45425e70b4dab2128f34172e4dc3f9ff2eeb47e909267d4252794ec7--
`
body, content, err := minimalParse(testMessage)
if err == nil {
t.Fatal("should have error but is", err)
}
t.Log("==BODY==")
t.Log(body)
t.Log("==CONTENT==")
t.Log(content)
}
func TestParse(t *testing.T) {
testMessage :=
`From: John Doe <example@example.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="XXXXboundary text"
This is a multipart message in MIME format.
--XXXXboundary text
Content-Type: text/plain; charset=utf-8
this is the body text
--XXXXboundary text
Content-Type: text/html; charset=utf-8
<html><body>this is the html body text</body></html>
--XXXXboundary text
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="test.txt"
this is the attachment text
--XXXXboundary text
Content-Type: image/jpeg; name="images-2.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="images-2.jpg"
/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUSEhIWFRUVFRcXFRgVFRUVFRcYFRYWFhUX
FhUYHSggGBolHRUVIjEhJSktLi4uFx8zODMtNygtLisBCgoKDg0OGhAQGislHyUtLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIALcBEwMBIgACEQED
EQH/xAAcAAAABwEBAAAAAAAAAAAAAAAAAQIDBAUGBwj/xAA9EAABAwIEBAQDBwIGAQUAAAABAAIR
AyEEBRIxBkFRYRMicYEykaEHQlKxwdHwFOEjM0NigvEWFRckcpL/xAAYAQADAQEAAAAAAAAAAAAA
AAAAAQIDBP/EACIRAQEAAgMAAgIDAQAAAAAAAAABAhESITEDQVFhEyIyof/aAAwDAQACEQMRAD8A
6CEYTco5UrPBYLjhx8Vg5Qf0W6Dli+PqXla/o6PmlRGbY+E8111X03ElXeQYQVqzWn4Rc/spir02
fCuA0Uw8i7r+3JXj3JhlZrPLMQlPdK0ZlNKeamKafanCpaCJBAGjRIIA1DzDHNpi+52HMp3F4kU2
lx5e6zbHeIS9xkk77COw6fss889dT1phhvu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ctkrwn
dLd/4FamlHJINHZGxxVraZ5j2klCnTG5Efz+fNWJofz+BJ8E7xP0T2OKFoFvrt/OaBpNPL5f3Us0
jv8A3SXNPQ/NBaRm4dsbfP8AdEcODy+qk6L/AM90lzOUf25WQDBw6LwO3yUhzD/O6AHVII39P2B9
UFIv0H89kaBuLoG6MoIJNARAIIIIco4QQQYoQCCCYCEEEEAERKCCAOQgSiQQQwURciQQBlBBBIBK
TqRoIApQlGggySjCNBAJQcgggEAIFqCCASAklqCCALT1TfhDdEgggNI9v1SXM/ugggjDmHqEEEEy
0//Z
--XXXXboundary text--
`
_, _, _, _, err := androidParse(testMessage)
if err != nil {
t.Error("parse error", err)
}
}