Debian Codegraph @

server/smtp_server_test.go

raw
1 package server
2
3 import (
4 "bufio"
5 "github.com/emersion/go-smtp"
6 "github.com/stretchr/testify/require"
7 "io"
8 "net"
9 "net/http"
10 "strings"
11 "testing"
12 "time"
13 )
14
15 func TestSmtpBackend_Multipart(t *testing.T) {
16 email := `EHLO example.com
17 MAIL FROM: [email protected]
18 RCPT TO: [email protected]
19 DATA
20 MIME-Version: 1.0
21 Date: Tue, 28 Dec 2021 00:30:10 +0100
22 Message-ID: <CAAvm79YP0C=Rt1N=KWmSUBB87KK2rRChmdzKqF1vCwMEUiVzLQ@mail.gmail.com>
23 Subject: and one more
24 From: Phil <[email protected]>
25 To: [email protected]
26 Content-Type: multipart/alternative; boundary="000000000000f3320b05d42915c9"
27
28 --000000000000f3320b05d42915c9
29 Content-Type: text/plain; charset="UTF-8"
30
31 what's up
32
33 --000000000000f3320b05d42915c9
34 Content-Type: text/html; charset="UTF-8"
35
36 <div dir="ltr">what&#39;s up<br clear="all"><div><br></div></div>
37
38 --000000000000f3320b05d42915c9--
39 .
40 `
41 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
42 require.Equal(t, "/mytopic", r.URL.Path)
43 require.Equal(t, "and one more", r.Header.Get("Title"))
44 require.Equal(t, "what's up", readAll(t, r.Body))
45 })
46 defer s.Close()
47 defer c.Close()
48 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
49 }
50
51 func TestSmtpBackend_MultipartNoBody(t *testing.T) {
52 email := `EHLO example.com
53 MAIL FROM: [email protected]
54 RCPT TO: [email protected]
55 DATA
56 MIME-Version: 1.0
57 Date: Tue, 28 Dec 2021 01:33:34 +0100
58 Message-ID: <[email protected]>
59 Subject: This email has a subject but no body
60 From: Phil <[email protected]>
61 To: [email protected]
62 Content-Type: multipart/alternative; boundary="000000000000bcf4a405d429f8d4"
63
64 --000000000000bcf4a405d429f8d4
65 Content-Type: text/plain; charset="UTF-8"
66
67
68
69 --000000000000bcf4a405d429f8d4
70 Content-Type: text/html; charset="UTF-8"
71
72 <div dir="ltr"><br></div>
73
74 --000000000000bcf4a405d429f8d4--
75 .
76 `
77 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
78 require.Equal(t, "/emailtest", r.URL.Path)
79 require.Equal(t, "", r.Header.Get("Title")) // We flipped message and body
80 require.Equal(t, "This email has a subject but no body", readAll(t, r.Body))
81 })
82 defer s.Close()
83 defer c.Close()
84 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
85 }
86
87 func TestSmtpBackend_Plaintext(t *testing.T) {
88 email := `EHLO example.com
89 MAIL FROM: [email protected]
90 RCPT TO: [email protected]
91 DATA
92 Date: Tue, 28 Dec 2021 00:30:10 +0100
93 Message-ID: <CAAvm79YP0C=Rt1N=KWmSUBB87KK2rRChmdzKqF1vCwMEUiVzLQ@mail.gmail.com>
94 Subject: and one more
95 From: Phil <[email protected]>
96 To: [email protected]
97 Content-Type: text/plain; charset="UTF-8"
98
99 what's up
100 .
101 `
102 s, c, conf, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
103 require.Equal(t, "/mytopic", r.URL.Path)
104 require.Equal(t, "and one more", r.Header.Get("Title"))
105 require.Equal(t, "what's up", readAll(t, r.Body))
106 })
107 conf.SMTPServerAddrPrefix = ""
108 defer s.Close()
109 defer c.Close()
110 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
111 }
112
113 func TestSmtpBackend_Plaintext_No_ContentType(t *testing.T) {
114 email := `EHLO example.com
115 MAIL FROM: [email protected]
116 RCPT TO: [email protected]
117 DATA
118 Subject: Very short mail
119
120 what's up
121 .
122 `
123 s, c, conf, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
124 require.Equal(t, "/mytopic", r.URL.Path)
125 require.Equal(t, "Very short mail", r.Header.Get("Title"))
126 require.Equal(t, "what's up", readAll(t, r.Body))
127 })
128 conf.SMTPServerAddrPrefix = ""
129 defer s.Close()
130 defer c.Close()
131 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
132 }
133
134 func TestSmtpBackend_Plaintext_EncodedSubject(t *testing.T) {
135 email := `EHLO example.com
136 MAIL FROM: [email protected]
137 RCPT TO: [email protected]
138 DATA
139 Date: Tue, 28 Dec 2021 00:30:10 +0100
140 Subject: =?UTF-8?B?VGhyZWUgc2FudGFzIPCfjoXwn46F8J+OhQ==?=
141 From: Phil <[email protected]>
142 To: [email protected]
143 Content-Type: text/plain; charset="UTF-8"
144
145 what's up
146 .
147 `
148 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
149 require.Equal(t, "Three santas ๐ŸŽ…๐ŸŽ…๐ŸŽ…", r.Header.Get("Title"))
150 })
151 defer s.Close()
152 defer c.Close()
153 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
154 }
155
156 func TestSmtpBackend_Plaintext_TooLongTruncate(t *testing.T) {
157 email := `EHLO example.com
158 MAIL FROM: [email protected]
159 RCPT TO: [email protected]
160 DATA
161 Date: Tue, 28 Dec 2021 00:30:10 +0100
162 Message-ID: <CAAvm79YP0C=Rt1N=KWmSUBB87KK2rRChmdzKqF1vCwMEUiVzLQ@mail.gmail.com>
163 Subject: and one more
164 From: Phil <[email protected]>
165 To: [email protected]
166 Content-Type: text/plain; charset="UTF-8"
167
168 you know this is a string.
169 it's a long string.
170 it's supposed to be longer than the max message length
171 which is 4096 bytes,
172 it used to be 512 bytes, but I increased that for the UnifiedPush support
173 the 512 bytes was a little short, some people said
174 but it kinda makes sense when you look at what it looks like one a phone
175 heck this wasn't even half of it so far.
176 so i'm gonna fill the rest of this with AAAAAAAAAAAAAAAAAAAAAAAAAAA
177 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
178 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAa
179 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
180 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
181 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
182 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
183 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
184 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
185 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
186 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
187 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
188 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
189 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
190 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
191 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
192 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
193 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
194 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
195 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
196 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
197 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
198 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
199 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
200 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
201 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
202 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
203 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
204 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
205 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
206 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
207 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
208 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
209 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
210 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
211 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
212 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
213 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
214 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
215 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
216 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
217 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
218 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
219 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
220 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
221 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
222 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
223 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
224 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
225 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
226 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
227 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
228 and with BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
229 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
230 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
231 that should do it
232 .
233 `
234 s, c, conf, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
235 expected := `you know this is a string.
236 it's a long string.
237 it's supposed to be longer than the max message length
238 which is 4096 bytes,
239 it used to be 512 bytes, but I increased that for the UnifiedPush support
240 the 512 bytes was a little short, some people said
241 but it kinda makes sense when you look at what it looks like one a phone
242 heck this wasn't even half of it so far.
243 so i'm gonna fill the rest of this with AAAAAAAAAAAAAAAAAAAAAAAAAAA
244 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
245 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAa
246 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
247 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
248 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
249 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
250 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
251 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
252 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
253 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
254 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
255 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
256 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
257 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
258 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
259 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
260 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
261 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
262 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
263 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
264 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
265 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
266 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
267 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
268 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
269 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
270 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
271 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
272 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
273 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
274 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
275 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
276 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
277 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
278 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
279 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
280 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
281 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
282 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
283 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
284 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
285 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
286 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
287 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
288 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
289 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
290 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
291 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
292 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
293 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
294 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
295 and with BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
296 BBBBBBBBBBBBBBBBBBBBBBBBB`
297 require.Equal(t, 4096, len(expected)) // Sanity check
298 require.Equal(t, expected, readAll(t, r.Body))
299 })
300 defer s.Close()
301 defer c.Close()
302 conf.SMTPServerAddrPrefix = ""
303 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
304 }
305
306 func TestSmtpBackend_Plaintext_QuotedPrintable(t *testing.T) {
307 email := `EHLO example.com
308 MAIL FROM: [email protected]
309 RCPT TO: [email protected]
310 DATA
311 Date: Tue, 28 Dec 2021 00:30:10 +0100
312 Message-ID: <CAAvm79YP0C=Rt1N=KWmSUBB87KK2rRChmdzKqF1vCwMEUiVzLQ@mail.gmail.com>
313 Subject: and one more
314 From: Phil <[email protected]>
315 To: [email protected]
316 Content-Type: text/plain; charset="UTF-8"
317 Content-Transfer-Encoding: quoted-printable
318
319 what's
320 =C3=A0&=C3=A9"'(-=C3=A8_=C3=A7=C3=A0)
321 =3D=3D=3D=3D=3D
322 up
323 .
324 `
325 s, c, conf, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
326 require.Equal(t, "/mytopic", r.URL.Path)
327 require.Equal(t, "and one more", r.Header.Get("Title"))
328 require.Equal(t, `what's
329 ร &รฉ"'(-รจ_รงร )
330 =====
331 up`, readAll(t, r.Body))
332 })
333 conf.SMTPServerAddrPrefix = ""
334 defer s.Close()
335 defer c.Close()
336 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
337 }
338
339 func TestSmtpBackend_Unsupported(t *testing.T) {
340 email := `EHLO example.com
341 MAIL FROM: [email protected]
342 RCPT TO: [email protected]
343 DATA
344 Date: Tue, 28 Dec 2021 00:30:10 +0100
345 Message-ID: <CAAvm79YP0C=Rt1N=KWmSUBB87KK2rRChmdzKqF1vCwMEUiVzLQ@mail.gmail.com>
346 Subject: and one more
347 From: Phil <[email protected]>
348 To: [email protected]
349 Content-Type: text/SOMETHINGELSE
350
351 what's up
352 .
353 `
354 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
355 t.Fatal("This should not be called")
356 })
357 defer s.Close()
358 defer c.Close()
359 writeAndReadUntilLine(t, email, c, scanner, "554 5.0.0 Error: transaction failed, blame it on the weather: unsupported content type")
360 }
361
362 func TestSmtpBackend_InvalidAddress(t *testing.T) {
363 email := `EHLO example.com
364 MAIL FROM: [email protected]
365 RCPT TO: [email protected]
366 DATA
367 Date: Tue, 28 Dec 2021 00:30:10 +0100
368 Subject: and one more
369 From: Phil <[email protected]>
370 To: [email protected]
371 Content-Type: text/plain
372
373 what's up
374 .
375 `
376 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
377 t.Fatal("This should not be called")
378 })
379 defer s.Close()
380 defer c.Close()
381 writeAndReadUntilLine(t, email, c, scanner, "451 4.0.0 invalid address")
382 }
383
384 func TestSmtpBackend_Base64Body(t *testing.T) {
385 email := `EHLO example.com
386 MAIL FROM: [email protected]
387 RCPT TO: [email protected]
388 DATA
389 Content-Type: multipart/mixed; boundary="===============2138658284696597373=="
390 MIME-Version: 1.0
391 Subject: TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local
392 From: =?utf-8?q?Robbie?= <[email protected]>
393 To: [email protected]
394 Date: Thu, 16 Feb 2023 01:04:00 -0000
395 Message-ID: <truenas-20230216.010400.344514.b'8jfL'@truenas.local>
396
397 This is a multi-part message in MIME format.
398 --===============2138658284696597373==
399 Content-Type: text/plain; charset="utf-8"
400 MIME-Version: 1.0
401 Content-Transfer-Encoding: base64
402
403 VGhpcyBpcyBhIHRlc3QgbWVzc2FnZSBmcm9tIFRydWVOQVMgQ09SRS4=
404
405 --===============2138658284696597373==
406 Content-Type: text/html; charset="utf-8"
407 MIME-Version: 1.0
408 Content-Transfer-Encoding: base64
409
410 PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv
411 L0VOIj4KClRoaXMgaXMgYSB0ZXN0IG1lc3NhZ2UgZnJvbSBUcnVlTkFTIENPUkUuCg==
412
413 --===============2138658284696597373==--
414 .
415 `
416 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
417 require.Equal(t, "/mytopic", r.URL.Path)
418 require.Equal(t, "TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local", r.Header.Get("Title"))
419 require.Equal(t, "This is a test message from TrueNAS CORE.", readAll(t, r.Body))
420 })
421 defer s.Close()
422 defer c.Close()
423 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
424 }
425
426 func TestSmtpBackend_MultipartQuotedPrintable(t *testing.T) {
427 email := `EHLO example.com
428 MAIL FROM: [email protected]
429 RCPT TO: [email protected]
430 DATA
431 MIME-Version: 1.0
432 Date: Tue, 28 Dec 2021 00:30:10 +0100
433 Message-ID: <CAAvm79YP0C=Rt1N=KWmSUBB87KK2rRChmdzKqF1vCwMEUiVzLQ@mail.gmail.com>
434 Subject: and one more
435 From: Phil <[email protected]>
436 To: [email protected]
437 Content-Type: multipart/alternative; boundary="000000000000f3320b05d42915c9"
438
439 --000000000000f3320b05d42915c9
440 Content-Type: text/html; charset="UTF-8"
441
442 html, ignore me
443
444 --000000000000f3320b05d42915c9
445 Content-Type: text/plain; charset="UTF-8"
446 Content-Transfer-Encoding: quoted-printable
447
448 what's
449 =C3=A0&=C3=A9"'(-=C3=A8_=C3=A7=C3=A0)
450 =3D=3D=3D=3D=3D
451 up
452
453 --000000000000f3320b05d42915c9--
454 .
455 `
456 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
457 require.Equal(t, "/mytopic", r.URL.Path)
458 require.Equal(t, "and one more", r.Header.Get("Title"))
459 require.Equal(t, `what's
460 ร &รฉ"'(-รจ_รงร )
461 =====
462 up`, readAll(t, r.Body))
463 })
464 defer s.Close()
465 defer c.Close()
466 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
467 }
468
469 func TestSmtpBackend_NestedMultipartBase64(t *testing.T) {
470 email := `EHLO example.com
471 MAIL FROM: [email protected]
472 RCPT TO: [email protected]
473 DATA
474 Content-Type: multipart/mixed; boundary="===============2138658284696597373=="
475 MIME-Version: 1.0
476 Subject: TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local
477 From: =?utf-8?q?Robbie?= <[email protected]>
478 To: [email protected]
479 Date: Thu, 16 Feb 2023 01:04:00 -0000
480 Message-ID: <truenas-20230216.010400.344514.b'8jfL'@truenas.local>
481
482 This is a multi-part message in MIME format.
483 --===============2138658284696597373==
484 Content-Type: multipart/alternative; boundary="===============2233989480071754745=="
485 MIME-Version: 1.0
486
487 --===============2233989480071754745==
488 Content-Type: text/plain; charset="utf-8"
489 MIME-Version: 1.0
490 Content-Transfer-Encoding: base64
491
492 VGhpcyBpcyBhIHRlc3QgbWVzc2FnZSBmcm9tIFRydWVOQVMgQ09SRS4=
493
494 --===============2233989480071754745==
495 Content-Type: text/html; charset="utf-8"
496 MIME-Version: 1.0
497 Content-Transfer-Encoding: base64
498
499 PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv
500 L0VOIj4KClRoaXMgaXMgYSB0ZXN0IG1lc3NhZ2UgZnJvbSBUcnVlTkFTIENPUkUuCg==
501
502 --===============2233989480071754745==--
503
504 --===============2138658284696597373==--
505 .
506 `
507
508 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
509 require.Equal(t, "/mytopic", r.URL.Path)
510 require.Equal(t, "TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local", r.Header.Get("Title"))
511 require.Equal(t, "This is a test message from TrueNAS CORE.", readAll(t, r.Body))
512 })
513 defer s.Close()
514 defer c.Close()
515 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
516 }
517
518 func TestSmtpBackend_NestedMultipartTooDeep(t *testing.T) {
519 email := `EHLO example.com
520 MAIL FROM: [email protected]
521 RCPT TO: [email protected]
522 DATA
523 Content-Type: multipart/mixed; boundary="===============1=="
524 MIME-Version: 1.0
525 Subject: TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local
526 From: =?utf-8?q?Robbie?= <[email protected]>
527 To: [email protected]
528 Date: Thu, 16 Feb 2023 01:04:00 -0000
529 Message-ID: <truenas-20230216.010400.344514.b'8jfL'@truenas.local>
530
531 This is a multi-part message in MIME format.
532 --===============1==
533 Content-Type: multipart/alternative; boundary="===============2=="
534 MIME-Version: 1.0
535
536 --===============2==
537 Content-Type: multipart/alternative; boundary="===============3=="
538 MIME-Version: 1.0
539
540 --===============3==
541 Content-Type: text/plain; charset="utf-8"
542 MIME-Version: 1.0
543 Content-Transfer-Encoding: base64
544
545 VGhpcyBpcyBhIHRlc3QgbWVzc2FnZSBmcm9tIFRydWVOQVMgQ09SRS4=
546
547 --===============3==
548 Content-Type: text/html; charset="utf-8"
549 MIME-Version: 1.0
550 Content-Transfer-Encoding: base64
551
552 PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv
553 L0VOIj4KClRoaXMgaXMgYSB0ZXN0IG1lc3NhZ2UgZnJvbSBUcnVlTkFTIENPUkUuCg==
554
555 --===============3==--
556
557 --===============2==--
558
559 --===============1==--
560 .
561 `
562
563 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
564 t.Fatal("This should not be called")
565 })
566 defer s.Close()
567 defer c.Close()
568 writeAndReadUntilLine(t, email, c, scanner, "554 5.0.0 Error: transaction failed, blame it on the weather: multipart message nested too deep")
569 }
570
571 func TestSmtpBackend_HTMLEmail(t *testing.T) {
572 email := `EHLO example.com
573 MAIL FROM: [email protected]
574 RCPT TO: [email protected]
575 DATA
576 Message-Id: <[email protected]>
577 From: <[email protected]>
578 To: <[email protected]>,
579 <[email protected]>
580 Date: Thu, 30 Mar 2023 02:56:53 +0000
581 Subject: A HTML email
582 Mime-Version: 1.0
583 Content-Type: text/html;
584 charset="utf-8"
585 Content-Transfer-Encoding: quoted-printable
586
587 <=21DOCTYPE html>
588 <html>
589 <head>
590 <title>Alerttitle</title>
591 <meta http-equiv=3D"content-type" content=3D"text/html;charset=3Dutf-8"/>
592 </head>
593 <body style=3D"color: =23000000; background-color: =23f0eee6;">
594 <table width=3D"100%" align=3D"center" style=3D"border:solid 2px =23eeeeee=
595 ; border-collapse: collapse;">
596 <tr>
597 <td>
598 <table style=3D"border-collapse: collapse;">
599
600
601
602
603
604
605
606 <tr>
607 <td style=3D"background: =23FFFFFF;">
608 <table style=3D"color: =23FFFFFF; background-color: =23006EC0; border-coll=
609 apse: collapse;">
610 <tr>
611 <td style=3D"width: 1000px; text-align: center; font-size: 18pt; font-fami=
612 ly: Arial, Helvetica, sans-serif; padding: 10px;">
613
614
615 headertext of table
616
617 </td>
618 </tr>
619 </table>
620 </td>
621 </tr>
622
623
624
625
626
627
628
629 <tr>
630 <td style=3D"padding: 10px 20px; background: =23FFFFFF;">
631 <table style=3D"border-collapse: collapse;">
632 <tr>
633 <td style=3D"width: 940px; font-size: 13pt; font-family: Arial, Helvetica,=
634 sans-serif; text-align: left;">
635 " Very important information about a change in your
636 home automation setup
637
638 Now the light is on
639 </td>
640 </tr>
641 </table>
642 </td>
643 </tr>
644
645
646
647 <tr>
648 <td style=3D"padding: 10px 20px; background: =23FFFFFF;">
649 <table>
650 <tr>
651 <td style=3D"width: 960px; font-size: 10pt; font-family: Arial, Helvetica,=
652 sans-serif; text-align: left;">
653 <hr />
654 If you don't want to receive this message anymore, stop the push
655 services in your <a href=3D"https:fritzbox" target=3D"_=
656 blank">FRITZ=21Box</a>=2E<br />
657 Here you can see the active push services: "System > Push Service"=2E
658 </td>
659 </tr>
660 </table>
661 </td>
662 </tr>
663 <tr>
664 <td>
665 <table style=3D"color: =23FFFFFF; background-color: =23006EC0;">
666 <tr>
667 <td style=3D"width: 1000px; font-size: 10pt; font-family: Arial, Helvetica=
668 , sans-serif; text-align: center; padding: 10px;">
669 This mail has ben sent by your <a style=3D"color: =23FFFFFF;" href=3D"https:=
670 //fritzbox" target=3D"_blank">FRITZ=21Box</a=
671 > automatically=2E
672 </td>
673 </tr>
674 </table>
675 </td>
676 </tr>
677 </table>
678 </td>
679 </tr>
680 </table>
681 </body>
682 </html>
683 .
684 `
685
686 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
687 require.Equal(t, "/mytopic", r.URL.Path)
688 require.Equal(t, "A HTML email", r.Header.Get("Title"))
689 expected := `headertext of table
690
691 &#34; Very important information about a change in your
692 home automation setup
693
694 Now the light is on
695
696 If you don&#39;t want to receive this message anymore, stop the push
697 services in your FRITZ!Box .
698
699 Here you can see the active push services: &#34;System &gt; Push Service&#34;.
700
701 This mail has ben sent by your FRITZ!Box automatically.`
702 require.Equal(t, expected, readAll(t, r.Body))
703 })
704 defer s.Close()
705 defer c.Close()
706 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
707 }
708
709 const spamEmail = `
710 EHLO example.com
711 MAIL FROM: [email protected]
712 RCPT TO: [email protected]
713 DATA
714 Delivered-To: [email protected]
715 Received: by 2002:a05:651c:1248:b0:2bf:c263:285 with SMTP id h8csp1096496ljh;
716 Mon, 30 Oct 2023 06:23:08 -0700 (PDT)
717 X-Google-Smtp-Source: AGHT+IFsB3WqbwbeefbeefbeefbeefbeefiXRNDHnIy2xBeaYHZCM3EC8DfPv55qDtgq9djTeBCF
718 X-Received: by 2002:a05:6808:147:b0:3af:66e5:5d3c with SMTP id h7-20020a056808014700b003af66e55d3cmr11662458oie.26.1698672188132;
719 Mon, 30 Oct 2023 06:23:08 -0700 (PDT)
720 ARC-Seal: i=1; a=rsa-sha256; t=1698672188; cv=none;
721 d=google.com; s=arc-20160816;
722 b=XM96KvnTbr4h6bqrTPTuuDNXmFCr9Be/HvVhu+UsSQjP9RxPk0wDTPUPZ/HWIJs52y
723 beeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeef
724 BUmQ==
725 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
726 h=list-unsubscribe-post:list-unsubscribe:mime-version:subject:to
727 :reply-to:from:date:message-id:dkim-signature:dkim-signature;
728 bh=BERwBIp6fBgrZePFKQjyNMmgPkcnq1Zy1jPO8M0T4Ok=;
729 fh=+kTCcNpX22TOI/SVSLygnrDqWeUt4zW7QKiv0TOVSGs=;
730 b=lyIBRuOxPOTY2s36OqP7M7awlBKd4t5PX9mJOEJB0eTnTZqML+cplrXUIg2ZTlAAi9
731 beeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeef
732 tgVQ==
733 ARC-Authentication-Results: i=1; mx.google.com;
734 dkim=pass [email protected] header.s=2020294246 header.b=G8y6xmtK;
735 dkim=pass [email protected] header.s=1000073432 header.b=ht8IksVK;
736 spf=pass (google.com: domain of aigxeklyirlg+dvwkrmsgua==_1133104752381_suqcukvbeeynm/[email protected] designates 208.75.123.226 as permitted sender) smtp.mailfrom="AigXeKlyIRLG+DvWkRMsGUA==_1133104752381_sUQcUKVBEeynm/[email protected]";
737 dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=spamspam.com
738 Return-Path: <AigXeKlyIRLG+DvWkRMsGUA==_1133104752381_sUQcUKVBEeynm/[email protected]>
739 Received: from ccm30.constantcontact.com (ccm30.constantcontact.com. [208.75.123.226])
740 by mx.google.com with ESMTPS id h2-20020a05620a21c200b0076eeed38118si5450962qka.131.2023.10.30.06.23.07
741 for <[email protected]>
742 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
743 Mon, 30 Oct 2023 06:23:08 -0700 (PDT)
744 Received-SPF: pass (google.com: domain of aigxeklyirlg+dvwkrmsgua==_1133104752381_suqcukvbeeynm/[email protected] designates 208.75.123.226 as permitted sender) client-ip=208.75.123.226;
745 Authentication-Results: mx.google.com;
746 dkim=pass [email protected] header.s=2020294246 header.b=G8y6xmtK;
747 dkim=pass [email protected] header.s=1000073432 header.b=ht8IksVK;
748 spf=pass (google.com: domain of aigxeklyirlg+dvwkrmsgua==_1133104752381_suqcukvbeeynm/[email protected] designates 208.75.123.226 as permitted sender) smtp.mailfrom="AigXeKlyIRLG+DvWkRMsGUA==_1133104752381_sUQcUKVBEeynm/[email protected]";
749 dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=spamspam.com
750 Return-Path: <AigXeKlyIRLG+DvWkRMsGUA==_1133104752381_sUQcUKVBEeynm/[email protected]>
751 Received: from [10.252.0.3] ([10.252.0.3:53254] helo=p2-jbemailsyndicator12.ctct.net) by 10.249.225.20 (envelope-from <AigXeKlyIRLG+DvWkRMsGUA==_1133104752381_sUQcUKVBEeynm/[email protected]>) (ecelerity 4.3.1.999 r(:)) with ESMTP id A4/82-60517-B3EAF356; Mon, 30 Oct 2023 09:23:07 -0400
752 DKIM-Signature: v=1; q=dns/txt; a=rsa-sha256; c=relaxed/relaxed; s=2020294246; d=spamspam.com; h=date:mime-version:subject:X-Feedback-ID:X-250ok-CID:message-id:from:reply-to:list-unsubscribe:list-unsubscribe-post:to; bh=BERwBIp6fBgrZePFKQjyNMmgPkcnq1Zy1jPO8M0T4Ok=; b=G8y6xmtKv8asfEXA9o8dP+6foQjclo6j5sFREYVIJBbj5YJ5tqoiv5B04/qoRkoTBFDhmjt+BUua7AqDgPSnwbP2iPSA4fTJehnHhut1PyVUp/9vqSYlhxQehfdhma8tPg8ArKfYIKmfKJwKRaQBU0JHCaB1m+5LNQQX3UjkxAg=
753 DKIM-Signature: v=1; q=dns/txt; a=rsa-sha256; c=relaxed/relaxed; s=1000073432; d=auth.ccsend.com; h=date:mime-version:subject:X-Feedback-ID:X-250ok-CID:message-id:from:reply-to:list-unsubscribe:list-unsubscribe-post:to; bh=BERwBIp6fBgrZePFKQjyNMmgPkcnq1Zy1jPO8M0T4Ok=; b=ht8IksVKYY/Kb3dUERWoeW4eVdYjKL6F4PEoIZOhfFXor6XAIbPnd3A/CPmbmoqFZjnKh5OdcUy1N5qEoj8w1Q3TmN8/ySQkqrlrmSDSZIHZMY7Qp9/TJrqUe4RMFOO1KKIN6Y0vGP1+dWe98msMAHwvi2qMjG9aEKLfFr2JUTQ=
754 Message-ID: <1140728754828.1133104752381.1941549819.0.260913JL.2002@synd.ccsend.com>
755 Date: Mon, 30 Oct 2023 09:23:07 -0400 (EDT)
756 From: spamspam Loan Servicing <[email protected]>
757 Reply-To: [email protected]
758 To: [email protected]
759 Subject: Buying a home? You deserve the confidence of Pre-Approval
760 MIME-Version: 1.0
761 Content-Type: multipart/alternative; boundary="----=_Part_75055660_144854819.1698672187348"
762 List-Unsubscribe: <https://visitor.constantcontact.com/do?p=un&m=beefbeefbeef>
763 List-Unsubscribe-Post: List-Unsubscribe=One-Click
764 X-Campaign-Activity-ID: 8a05de2a-5c88-44b1-be0e-f5a444cb0650
765 X-250ok-CID: 8a05de2a-5c88-44b1-be0e-f5a444cb0650
766 X-Channel-ID: b1441c50-a541-11ec-a79b-fa163e5bc304
767 X-Return-Path-Hint: AbeefbeefbeefbeefbeefUA==_1133104752381_sUQcUKVBEeynm/[email protected]
768 X-Roving-Campaignid: 1140728754811
769 X-Roving-Id: 1133104752381.1111111111
770 X-Feedback-ID: b1441c50-a541-11ec-beef-beefbeefbeefbeef5de2a-5c88-44b1-be0e-f5a444cb0650:1133104752381:CTCT
771 X-CTCT-ID: b13a9586-a541-11ec-beef-beefbeefbeef
772
773 ------=_Part_75055660_144854819.1698672187348
774 Content-Type: text/plain; charset=utf-8
775 Content-Transfer-Encoding: quoted-printable
776
777 When you're buying a home, Pre-Approval gives you confidence you're in the =
778 right price range and shows sellers you mean business. xxxxxxxxx SELLING or=
779 BUYING? Call: 844-590-2275 Get Your Homebuying PRE-APPROVAL IN 24-HOURS* G=
780 et Pre-Approved When you're buying a home, Pre-Approval gives you confidenc=
781 e you're in the right price range and shows sellers you mean business. xxx=
782 xxxxxxGet Pre-Approved today! Click or Call to Get Pre-Approved 844-590-227=
783 5 Get Pre-Approved nmlsconsumeraccess.org/ *The 24 hour timeframe is for mo=
784 st approvals, however if additional information is needed or a request is o=
785 n a holiday, the time for preapproval may be greater than 24 hours. This em=
786 ail is for informational purposes only and is not an offer, loan approval o=
787 r loan commitment. Mortgage rates are subject to change without notice. Som=
788 e terms and restrictions may apply to certain loan programs. Refinancing ex=
789 isting loans may result in total finance charges being higher over the life=
790 of the loan, reduction in payments may partially reflect a longer loan ter=
791 m. This information is provided as guidance and illustrative purposes only =
792 and does not constitute legal or financial advice. We are not liable or bou=
793 nd legally for any answers provided to any user for our process or position=
794 on an issue. This information may change from time to time and at any time=
795 without notification. The most current information will be updated periodi=
796 cally and posted in the online forum. spamspam Loan Servicing, LLC. NMLS#39=
797 1521. nmlsconsumeraccess.org. You are receiving this information as a curre=
798 nt loan customer with spamspam Loan Servicing, LLC. Not licensed for lendin=
799 g activities in any of the U.S. territories. Not authorized to originate lo=
800 ans in the State of New York. Licensed by the Dept. of Financial Protection=
801 and Innovation under the California Residential Mortgage .Lending Act #413=
802 1216. This email was sent to [email protected] Version 103023PCHPrAp=
803 9 xxxxxxxxx spamspam Loan Servicing | 4425 Ponce de Leon Blvd 5-251, Coral =
804 Gables, FL 33146-1837 Unsubscribe [email protected] Update Profile |=
805 Our Privacy Policy | Constant Contact Data Notice Sent by marklake@spamspa=
806 m.com
807 ------=_Part_75055660_144854819.1698672187348
808 Content-Type: text/html; charset=utf-8
809 Content-Transfer-Encoding: quoted-printable
810
811 <!DOCTYPE HTML>
812 <html lang=3D"en-US"> <head> <meta http-equiv=3D"Content-Type" content=3D"=
813 text/html; charset=3Dutf-8"> <meta name=3D"viewport" content=3D"width=3Ddev=
814 ice-width, initial-scale=3D1, maximum-scale=3D1"> <style type=3D"text/css=
815 " data-premailer=3D"ignore">=20
816 @media only screen and (max-width:480px) { .footer-main-width { width: 100%=
817 !important; } .footer-mobile-hidden { display: none !important; } .foote=
818 r-mobile-hidden { display: none !important; } .footer-column { display: bl=
819 ock !important; } .footer-mobile-stack { display: block !important; } .fo=
820 oter-mobile-stack-padding { padding-top: 3px; } }=20
821 /* IE: correctly scale images with w/h attbs */ img { -ms-interpolation-mod=
822 e: bicubic; }=20
823 .layout { min-width: 100%; }=20
824 table { table-layout: fixed; } .shell_outer-row { table-layout: auto; }=20
825 /* Gmail/Web viewport fix */ u + .body .shell_outer-row { width: 620px; }=
826 =20
827 /* LIST AND p STYLE OVERRIDES */ .text .text_content-cell p { margin: 0; pa=
828 dding: 0; margin-bottom: 0; } .text .text_content-cell ul, .text .text_cont=
829 ent-cell ol { padding: 0; margin: 0 0 0 40px; } .text .text_content-cell li=
830 { padding: 0; margin: 0; /* line-height: 1.2; Remove after testing */ } /*=
831 Text Link Style Reset */ a { text-decoration: underline; } /* iOS: Autolin=
832 k styles inherited */ a[x-apple-data-detectors] { text-decoration: underlin=
833 e !important; font-size: inherit !important; font-family: inherit !importan=
834 t; font-weight: inherit !important; line-height: inherit !important; color:=
835 inherit !important; } /* FF/Chrome: Smooth font rendering */ .text .text_c=
836 ontent-cell { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing:=
837 grayscale; }=20
838 </style> <!--[if gte mso 9]> <style id=3D"ol-styles">=20
839 /* OUTLOOK-SPECIFIC STYLES */ li { text-indent: -1em; padding: 0; margin: 0=
840 ; /* line-height: 1.2; Remove after testing */ } ul, ol { padding: 0; margi=
841 n: 0 0 0 40px; } p { margin: 0; padding: 0; margin-bottom: 0; }=20
842 </style> <![endif]--> <style>@media only screen and (max-width:480px) {
843 .button_content-cell {
844 padding-top: 10px !important; padding-right: 20px !important; padding-botto=
845 m: 10px !important; padding-left: 20px !important;
846 }
847 .button_border-row .button_content-cell {
848 padding-top: 10px !important; padding-right: 20px !important; padding-botto=
849 m: 10px !important; padding-left: 20px !important;
850 }
851 .column .content-padding-horizontal {
852 padding-left: 20px !important; padding-right: 20px !important;
853 }
854 .layout .column .content-padding-horizontal .content-padding-horizontal {
855 padding-left: 0px !important; padding-right: 0px !important;
856 }
857 .layout .column .content-padding-horizontal .block-wrapper_border-row .cont=
858 ent-padding-horizontal {
859 padding-left: 20px !important; padding-right: 20px !important;
860 }
861 .dataTable {
862 overflow: auto !important;
863 }
864 .dataTable .dataTable_content {
865 width: auto !important;
866 }
867 .image--mobile-scale .image_container img {
868 width: auto !important;
869 }
870 .image--mobile-center .image_container img {
871 margin-left: auto !important; margin-right: auto !important;
872 }
873 .layout-margin .layout-margin_cell {
874 padding: 0px 20px !important;
875 }
876 .layout-margin--uniform .layout-margin_cell {
877 padding: 20px 20px !important;
878 }
879 .scale {
880 width: 100% !important;
881 }
882 .stack {
883 display: block !important; box-sizing: border-box;
884 }
885 .hide {
886 display: none !important;
887 }
888 u + .body .shell_outer-row {
889 width: 100% !important;
890 }
891 .socialFollow_container {
892 text-align: center !important;
893 }
894 .text .text_content-cell {
895 font-size: 16px !important;
896 }
897 .text .text_content-cell h1 {
898 font-size: 24px !important;
899 }
900 .text .text_content-cell h2 {
901 font-size: 20px !important;
902 }
903 .text .text_content-cell h3 {
904 font-size: 20px !important;
905 }
906 .text--sectionHeading .text_content-cell {
907 font-size: 26px !important;
908 }
909 .text--heading .text_content-cell {
910 font-size: 26px !important;
911 }
912 .text--feature .text_content-cell h2 {
913 font-size: 20px !important;
914 }
915 .text--articleHeading .text_content-cell {
916 font-size: 20px !important;
917 }
918 .text--article .text_content-cell h3 {
919 font-size: 20px !important;
920 }
921 .text--featureHeading .text_content-cell {
922 font-size: 20px !important;
923 }
924 .text--feature .text_content-cell h3 {
925 font-size: 20px !important;
926 }
927 .text--dataTable .text_content-cell .dataTable .dataTable_content-cell {
928 font-size: 12px !important;
929 }
930 .text--dataTable .text_content-cell .dataTable th.dataTable_content-cell {
931 font-size: px !important;
932 }
933 }
934 </style>
935 </head> <body class=3D"body template template--en-US" data-template-version=
936 =3D"1.38.0" data-canonical-name=3D"CPE10001" lang=3D"en-US" align=3D"center=
937 " style=3D"-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; min-=
938 width: 100%; width: 100%; margin: 0px; padding: 0px;"> <div id=3D"preheader=
939 " style=3D"color: transparent; display: none; font-size: 1px; line-height: =
940 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden;"><span =
941 data-entity-ref=3D"preheader">When you&#x27;re buying a home, Pre-Approval =
942 gives you confidence you&#x27;re in the right price range and shows sellers=
943 you mean business. </span></div> <div id=3D"tracking-image" style=3D"color=
944 : transparent; display: none; font-size: 1px; line-height: 1px; max-height:=
945 0px; max-width: 0px; opacity: 0; overflow: hidden;"><img src=3D"https://r2=
946 0.rs6.net/on.jsp?ca=beefbeefbe-beef-44b1-be0e-f5a444cb0650&a=3D113310475238=
947 1&c=3Db13a9586-a541-11ec-a79b-fa163e5bc304&ch=3Db1441c50-a541-11ec-a79b-fa1=
948 63e5bc304" / alt=3D""></div> <div class=3D"shell" lang=3D"en-US" style=3D"b=
949 ackground-color: #015288;"> <table class=3D"shell_panel-row" width=3D"100%=
950 " border=3D"0" cellpadding=3D"0" cellspacing=3D"0" style=3D"background-colo=
951 r: #015288;" bgcolor=3D"#015288"> <tr class=3D""> <td class=3D"shell_panel-=
952 cell" style=3D"" align=3D"center" valign=3D"top"> <table class=3D"shell_wid=
953 th-row scale" style=3D"width: 620px;" align=3D"center" border=3D"0" cellpad=
954 ding=3D"0" cellspacing=3D"0"> <tr> <td class=3D"shell_width-cell" style=3D"=
955 padding: 15px 10px;" align=3D"center" valign=3D"top"> <table class=3D"shell=
956 _content-row" width=3D"100%" align=3D"center" border=3D"0" cellpadding=3D"0=
957 " cellspacing=3D"0"> <tr> <td class=3D"shell_content-cell" style=3D"border-=
958 radius: 0px; background-color: #FFFFFF; padding: 0; border: 0px solid #0096=
959 d6;" align=3D"center" valign=3D"top" bgcolor=3D"#FFFFFF"> <table class=3D"l=
960 ayout layout--1-column" style=3D"table-layout: fixed;" width=3D"100%" borde=
961 r=3D"0" cellpadding=3D"0" cellspacing=3D"0"> <tr> <td class=3D"column colum=
962 n--1 scale stack" style=3D"width: 100%;" align=3D"center" valign=3D"top">
963 <table class=3D"divider" width=3D"100%" cellpadding=3D"0" cellspacing=3D"0"=
964 border=3D"0"> <tr> <td class=3D"divider_container" style=3D"padding-top: 0=
965 px; padding-bottom: 10px;" width=3D"100%" align=3D"center" valign=3D"top"> =
966 <table class=3D"divider_content-row" style=3D"width: 100%; height: 1px;" ce=
967 llpadding=3D"0" cellspacing=3D"0" border=3D"0"> <tr> <td class=3D"divider_c=
968 ontent-cell" style=3D"padding-bottom: 5px; height: 1px; line-height: 1px; b=
969 ackground-color: #0096D6; border-bottom-width: 0px;" height=3D"1" align=3D"=
970 center" bgcolor=3D"#0096D6"> <img alt=3D"" width=3D"5" height=3D"1" border=
971 =3D"0" hspace=3D"0" vspace=3D"0" src=3D"https://imgssl.constantcontact.com/=
972 letters/images/1101116784221/S.gif" style=3D"display: block; height: 1px; w=
973 idth: 5px;"> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table>=
974 <table class=3D"layout layout--1-column" style=3D"table-layout: fixed;" wi=
975 dth=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0"> <tr> <td cla=
976 ss=3D"column column--1 scale stack" style=3D"width: 100%;" align=3D"center"=
977 valign=3D"top"><div class=3D"spacer" style=3D"line-height: 10px; height: 1=
978 0px;">&#x200a;</div></td> </tr> </table> <table class=3D"layout layout--1-c=
979 olumn" style=3D"table-layout: fixed;" width=3D"100%" border=3D"0" cellpaddi=
980 ng=3D"0" cellspacing=3D"0"> <tr> <td class=3D"column column--1 scale stack"=
981 style=3D"width: 100%;" align=3D"center" valign=3D"top">
982 <table class=3D"image image--padding-vertical image--mobile-scale image--mo=
983 bile-center" width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0=
984 "> <tr> <td class=3D"image_container" align=3D"center" valign=3D"top" style=
985 =3D"padding-top: 10px; padding-bottom: 10px;"> <a href=3D"https://r20.rs6.n=
986 et/tn.jsp?f=3D001YKO1VR2jLW0SuSLZLfN7qCP9AwEGO0v-Vy-0SCUlMWvTEiCsv-QEMhmJe9=
987 ch=3DHu9wLy0fth6D8jxFBWPA_NhdnWcZZPivk0KUTgRJoVIo_si10jiydw=3D=3D" data-tra=
988 ckable=3D"true"><img data-image-content class=3D"image_content" width=3D"26=
989 2" src=3D"https://files.constantcontact.com/beefbeefbee/057bff2a-bdba-4165-=
990 b108-a7baa91c42c6.jpg" alt=3D"" style=3D"display: block; height: auto; max-=
991 width: 100%;"></a> </td> </tr> </table> </td> </tr> </table> <table class=
992 =3D"layout layout--heading layout--1-column" style=3D"background-color: #00=
993 527e; table-layout: fixed;" width=3D"100%" border=3D"0" cellpadding=3D"0" c=
994 ellspacing=3D"0" bgcolor=3D"#00527e"> <tr> <td class=3D"column column--1 sc=
995 ale stack" style=3D"width: 100%;" align=3D"center" valign=3D"top">
996 <table class=3D"text text--padding-vertical" width=3D"100%" border=3D"0" ce=
997 llpadding=3D"0" cellspacing=3D"0" style=3D"table-layout: fixed;"> <tr> <td =
998 class=3D"text_content-cell content-padding-horizontal" style=3D"text-align:=
999 center; font-family: Arial,Verdana,Helvetica,sans-serif; color: #000000; f=
1000 ont-size: 14px; line-height: 1.2; display: block; word-wrap: break-word; pa=
1001 dding: 10px 20px;" align=3D"center" valign=3D"top">
1002 <h1 style=3D"font-family: Arial,Verdana,Helvetica,sans-serif; color: #606d7=
1003 8; font-size: 26px; font-weight: bold; margin: 0;"><span style=3D"color: rg=
1004 b(0, 150, 214);">SELLING or BUYING?</span></h1>
1005 <p style=3D"margin: 0;"><span style=3D"font-size: 16px; color: rgb(255, 255=
1006 , 255); font-weight: bold;">Call: 844-590-2275</span></p>
1007 </td> </tr> </table> </td> </tr> </table> <table class=3D"layout layout--ar=
1008 ticle layout--1-column" style=3D"table-layout: fixed;" width=3D"100%" borde=
1009 r=3D"0" cellpadding=3D"0" cellspacing=3D"0"> <tr> <td class=3D"column colum=
1010 n--1 scale stack" style=3D"width: 100%;" align=3D"center" valign=3D"top">
1011 <table class=3D"text text--heading text--padding-vertical" width=3D"100%" b=
1012 order=3D"0" cellpadding=3D"0" cellspacing=3D"0" style=3D"table-layout: fixe=
1013 d;"> <tr> <td class=3D"text_content-cell content-padding-horizontal" style=
1014 =3D"text-align: center; font-family: Arial,Verdana,Helvetica,sans-serif; co=
1015 lor: #606d78; font-size: 26px; line-height: 1.2; display: block; word-wrap:=
1016 break-word; font-weight: bold; padding: 10px 20px;" align=3D"center" valig=
1017 n=3D"top">
1018 <p style=3D"margin: 0;"><span style=3D"font-size: 30px; color: rgb(0, 150, =
1019 214);">Get Your Homebuying</span></p>
1020 <p style=3D"margin: 0;"><span style=3D"font-size: 30px; color: rgb(0, 82, 1=
1021 26);">PRE-APPROVAL IN 24-HOURS</span><span style=3D"font-size: 30px; color:=
1022 rgb(0, 82, 126); font-weight: normal;">*</span></p>
1023 </td> </tr> </table> <table class=3D"image image--padding-vertical image--m=
1024 obile-scale image--mobile-center" width=3D"100%" border=3D"0" cellpadding=
1025 =3D"0" cellspacing=3D"0"> <tr> <td class=3D"image_container content-padding=
1026 -horizontal" align=3D"center" valign=3D"top" style=3D"padding: 10px 20px;">=
1027 <img data-image-content class=3D"image_content" width=3D"548" src=3D"https=
1028 ://files.constantcontact.com/df66e42d701/2092a2d7-0bda-4289-910b-bf50a2398d=
1029 60.jpg" alt=3D"" style=3D"display: block; height: auto; max-width: 100%;"> =
1030 </td> </tr> </table> <table class=3D"button button--padding-vertical" widt=
1031 h=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0" style=3D"table-=
1032 layout: fixed;"> <tr> <td class=3D"button_container content-padding-horizon=
1033 tal" align=3D"center" style=3D"padding: 10px 20px;"> <table class=3D"but=
1034 ton_content-row" style=3D"width: inherit; border-radius: 3px; border-spacin=
1035 g: 0; background-color: #0096D6; border: none;" border=3D"0" cellpadding=3D=
1036 "0" cellspacing=3D"0" bgcolor=3D"#0096D6"> <tr> <td class=3D"button_content=
1037 -cell" style=3D"padding: 10px 40px;" align=3D"center"> <a class=3D"button_l=
1038 ink" href=3D"https://r20.rs6.net/tn.jsp?f=3D001YKO1VR2jLW0SuSLZLfN7qCP9AwEG=
1039 O0v-Vy-0SCUlMWvTEiCsv-QEMuu9ZVVi6WGHhCias4f7-QkeggQvxIvbs-6TTaZHHhXLKf88NID=
1040 dci4Ge7aYN-QihEgqblie1-DQ2Fa1BKLbT3AM8rtrgeYQgVxJ6cG8POsvFzv7JstrGkCkg3a3AE=
1041 633LfQpAddyVLFkTv6oyS4T2j_YjYIPKDOZktqK_5rOR-Fh8cWGtUD8YPpPNnZ037z6_t9Nkemu=
1042 hxG&c=3DA65qX-dQJPS0J4afCS7H0Je5N-_6Q8Nh2fNHkb5-5biUYd5B9SY3zA=3D=3D&ch=3DH=
1043 u9wLy0fth6D8jxFBWPA_NhdnWcZZPivk0KUTgRJoVIo_si10jiydw=3D=3D" data-trackable=
1044 =3D"true" style=3D"font-size: 16px; font-weight: bold; color: #FFFFFF; font=
1045 -family: Helvetica,Arial,sans-serif; word-wrap: break-word; text-decoration=
1046 : none;">Get Pre-Approved</a> </td> </tr> </table> </td> </tr> </table> =
1047 <table class=3D"text text--padding-vertical" width=3D"100%" border=3D"0" =
1048 cellpadding=3D"0" cellspacing=3D"0" style=3D"table-layout: fixed;"> <tr> <t=
1049 d class=3D"text_content-cell content-padding-horizontal" style=3D"line-heig=
1050 ht: 1; text-align: center; font-family: Arial,Verdana,Helvetica,sans-serif;=
1051 color: #000000; font-size: 14px; display: block; word-wrap: break-word; pa=
1052 dding: 10px 20px;" align=3D"center" valign=3D"top">
1053 <p style=3D"text-align: left; margin: 0;" align=3D"left"><br></p>
1054 <p style=3D"margin: 0;"><span style=3D"font-size: 19px;">When you're buying=
1055 a home, Pre-Approval gives you confidence you're in the right price range =
1056 and shows sellers you mean business. </span></p>
1057 <p style=3D"margin: 0;"><span style=3D"font-size: 19px;">&#xfeff;Get Pre-Ap=
1058 proved today!</span></p>
1059 </td> </tr> </table> </td> </tr> </table> <table class=3D"layout layout--1-=
1060 column" style=3D"table-layout: fixed;" width=3D"100%" border=3D"0" cellpadd=
1061 ing=3D"0" cellspacing=3D"0"> <tr> <td class=3D"column column--1 scale stack=
1062 " style=3D"width: 100%;" align=3D"center" valign=3D"top">
1063 <table class=3D"text text--padding-vertical" width=3D"100%" border=3D"0" ce=
1064 llpadding=3D"0" cellspacing=3D"0" style=3D"table-layout: fixed;"> <tr> <td =
1065 class=3D"text_content-cell content-padding-horizontal" style=3D"text-align:=
1066 left; font-family: Arial,Verdana,Helvetica,sans-serif; color: #000000; fon=
1067 t-size: 14px; line-height: 1.2; display: block; word-wrap: break-word; padd=
1068 ing: 10px 20px;" align=3D"left" valign=3D"top">
1069 <p style=3D"text-align: center; margin: 0;" align=3D"center"><br></p>
1070 <p style=3D"text-align: center; margin: 0;" align=3D"center"><span style=3D=
1071 "font-size: 23px; color: rgb(0, 82, 126); font-weight: bold; font-family: A=
1072 rial, Verdana, Helvetica, sans-serif;">Click or Call to Get Pre-Approved </=
1073 span></p>
1074 <p style=3D"text-align: center; margin: 0;" align=3D"center"><span style=3D=
1075 "font-size: 28px; color: rgb(0, 150, 214); font-weight: bold;">844-590-2275=
1076 </span></p>
1077 </td> </tr> </table> </td> </tr> </table> <table class=3D"layout layout--1-=
1078 column" style=3D"table-layout: fixed;" width=3D"100%" border=3D"0" cellpadd=
1079 ing=3D"0" cellspacing=3D"0"> <tr> <td class=3D"column column--1 scale stack=
1080 " style=3D"width: 100%;" align=3D"center" valign=3D"top"> <table class=3D"b=
1081 utton button--padding-vertical" width=3D"100%" border=3D"0" cellpadding=3D"=
1082 0" cellspacing=3D"0" style=3D"table-layout: fixed;"> <tr> <td class=3D"butt=
1083 on_container content-padding-horizontal" align=3D"center" style=3D"padding:=
1084 10px 20px;"> <table class=3D"button_content-row" style=3D"background-co=
1085 lor: #0096D6; width: inherit; border-radius: 3px; border-spacing: 0; border=
1086 : none;" border=3D"0" cellpadding=3D"0" cellspacing=3D"0" bgcolor=3D"#0096D=
1087 6"> <tr> <td class=3D"button_content-cell" style=3D"padding: 10px 40px;" al=
1088 ign=3D"center"> <a class=3D"button_link" href=3D"https://r20.rs6.net/tn.jsp=
1089 ?f=3D001thisisfakethisisfakethisisfakev-Vy-0SCUlMWvTEiCsv-QEMuu9ZVVi6WGHhCi=
1090 oVIo_si10jiydw=3D=3D" data-trackable=3D"true" style=3D"font-size: 16px; fon=
1091 t-weight: bold; color: #FFFFFF; font-family: Helvetica,Arial,sans-serif; wo=
1092 rd-wrap: break-word; text-decoration: none;">Get Pre-Approved</a> </td> </t=
1093 r> </table> </td> </tr> </table> </td> </tr> </table> <table class=3D"=
1094 layout layout--1-column" style=3D"table-layout: fixed;" width=3D"100%" bord=
1095 er=3D"0" cellpadding=3D"0" cellspacing=3D"0"> <tr> <td class=3D"column colu=
1096 mn--1 scale stack" style=3D"width: 100%;" align=3D"center" valign=3D"top">
1097 <table class=3D"image image--padding-vertical image--mobile-scale image--mo=
1098 bile-center" width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0=
1099 "> <tr> <td class=3D"image_container" align=3D"center" valign=3D"top" style=
1100 =3D"padding-top: 10px; padding-bottom: 10px;"> <img data-image-content clas=
1101 s=3D"image_content" width=3D"87" src=3D"https://files.constantcontact.com/d=
1102 f66e42d701/beefbeef-beef-beef-9a13-2779ab497b8d.png" alt=3D"" style=3D"disp=
1103 lay: block; height: auto; max-width: 100%;"> </td> </tr> </table> </td> </t=
1104 r> </table> <table class=3D"layout layout--1-column" style=3D"table-layout:=
1105 fixed;" width=3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0"> <=
1106 tr> <td class=3D"column column--1 scale stack" style=3D"width: 100%;" align=
1107 =3D"center" valign=3D"top">
1108 <table class=3D"text text--padding-vertical" width=3D"100%" border=3D"0" ce=
1109 llpadding=3D"0" cellspacing=3D"0" style=3D"table-layout: fixed;"> <tr> <td =
1110 class=3D"text_content-cell content-padding-horizontal" style=3D"text-align:=
1111 left; font-family: Arial,Verdana,Helvetica,sans-serif; color: #000000; fon=
1112 t-size: 14px; line-height: 1.2; display: block; word-wrap: break-word; padd=
1113 ing: 10px 20px;" align=3D"left" valign=3D"top">
1114 <p style=3D"text-align: center; margin: 0;" align=3D"center"><br></p>
1115 <p style=3D"text-align: center; margin: 0;" align=3D"center"><a href=3D"htt=
1116 ps://r20.rs6.net/tn.jsp?f=3D001YKO1VR2jLW0SuSLZLfN7qCP9AwEGO0v-Vy-0SCUlMWvT=
1117 EiCsv-QEMgYju54LKeEV1_a2OCyOAfG7VhZpxtOW89WM-s6S5iiXcmnbK-Z6XDc9LL569h6DE4L=
1118 IRMWiBWHOlFB9TZWQVuX6Ycz3505y1keCrca4QArp&c=3DA65qX-dQJPS0J4afCS7H0Je5N-_6Q=
1119 8Nh2fNHkb5-5biUYd5B9SY3zA=3D=3D&ch=3DHu9wLy0fth6D8jxFBWPA_NhdnWcZZPivk0KUTg=
1120 RJoVIo_si10jiydw=3D=3D" target=3D"_blank" style=3D"font-size: 11px; color: =
1121 rgb(153, 153, 153); text-decoration: underline; font-weight: normal; font-s=
1122 tyle: normal;">nmlsconsumeraccess.org/</a></p>
1123 <p style=3D"text-align: center; margin: 0;" align=3D"center"><span style=3D=
1124 "font-size: 11px; color: rgb(153, 153, 153);">*The 24 hour timeframe is for=
1125 most approvals, however if additional information is needed or a request i=
1126 s on a holiday, the time for preapproval may be greater than 24 hours.</spa=
1127 n></p>
1128 <p style=3D"text-align: center; margin: 0;" align=3D"center"><span style=3D=
1129 "font-size: 11px; color: rgb(153, 153, 153); background-color: rgb(255, 255=
1130 , 255);">This email is for informational purposes only and is not an offer,=
1131 loan approval or loan commitment. Mortgage rates are subject to change wit=
1132 hout notice. Some terms and restrictions may apply to certain loan programs=
1133 . Refinancing existing loans may result in total finance charges being high=
1134 er over the life of the loan, reduction in payments may partially reflect a=
1135 longer loan term. This information is provided as guidance and illustrativ=
1136 e purposes only and does not constitute legal or financial advice. We are n=
1137 ot liable or bound legally for any answers provided to any user for our pro=
1138 cess or position on an issue. This information may change from time to time=
1139 and at any time without notification. The most current information will be=
1140 updated periodically and posted in the online forum.</span></p>
1141 <p style=3D"text-align: center; margin: 0;" align=3D"center"><span style=3D=
1142 "font-size: 11px; color: rgb(153, 153, 153); background-color: rgb(255, 255=
1143 , 255);">spamspam Loan Servicing, LLC. NMLS#391521. nmlsconsumeraccess.org.=
1144 You are receiving this information as a current loan customer with spamspa=
1145 m Loan Servicing, LLC. Not licensed for lending activities in any of the U.=
1146 S. territories. Not authorized to originate loans in the State of New York.=
1147 Licensed by the Dept. of Financial Protection and Innovation under the Cal=
1148 ifornia Residential Mortgage .Lending Act #4131216.</span></p>
1149 <p style=3D"text-align: center; margin: 0;" align=3D"center"><br></p>
1150 <p style=3D"text-align: center; margin: 0;" align=3D"center"><span style=3D=
1151 "font-size: 11px; color: rgb(153, 153, 153);">This email was sent to <span =
1152 data-id=3D"emailAddress">[email protected]</span></span></p>
1153 <p style=3D"text-align: center; margin: 0;" align=3D"center"><span style=3D=
1154 "font-size: 11px; color: rgb(153, 153, 153);">Version 103023PCHPrAp9 </span=
1155 ></p>
1156 <p style=3D"text-align: center; margin: 0;" align=3D"center"><span style=3D=
1157 "font-size: 11px; color: rgb(162, 162, 162);">&#xfeff;</span></p>
1158 </td> </tr> </table> </td> </tr> </table> <table class=3D"layout layout--1-=
1159 column" style=3D"table-layout: fixed;" width=3D"100%" border=3D"0" cellpadd=
1160 ing=3D"0" cellspacing=3D"0"> <tr> <td class=3D"column column--1 scale stack=
1161 " style=3D"width: 100%;" align=3D"center" valign=3D"top">
1162 <table class=3D"divider" width=3D"100%" cellpadding=3D"0" cellspacing=3D"0"=
1163 border=3D"0"> <tr> <td class=3D"divider_container" style=3D"padding-top: 1=
1164 0px; padding-bottom: 0px;" width=3D"100%" align=3D"center" valign=3D"top"> =
1165 <table class=3D"divider_content-row" style=3D"width: 100%; height: 1px;" ce=
1166 llpadding=3D"0" cellspacing=3D"0" border=3D"0"> <tr> <td class=3D"divider_c=
1167 ontent-cell" style=3D"padding-bottom: 2px; height: 1px; line-height: 1px; b=
1168 ackground-color: #0096D6; border-bottom-width: 0px;" height=3D"1" align=3D"=
1169 center" bgcolor=3D"#0096D6"> <img alt=3D"" width=3D"5" height=3D"1" border=
1170 =3D"0" hspace=3D"0" vspace=3D"0" src=3D"https://imgssl.constantcontact.com/=
1171 letters/images/1111111111111/S.gif" style=3D"display: block; height: 1px; w=
1172 idth: 5px;"> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table>=
1173 </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td class=3D"s=
1174 hell_panel-cell shell_panel-cell--systemFooter" style=3D"" align=3D"center"=
1175 valign=3D"top"> <table class=3D"shell_width-row scale" style=3D"width: 100=
1176 %;" align=3D"center" border=3D"0" cellpadding=3D"0" cellspacing=3D"0"> <tr>=
1177 <td class=3D"shell_width-cell" style=3D"padding: 0px;" align=3D"center" va=
1178 lign=3D"top"> <table class=3D"shell_content-row" width=3D"100%" align=3D"ce=
1179 nter" border=3D"0" cellpadding=3D"0" cellspacing=3D"0"> <tr> <td class=3D"s=
1180 hell_content-cell" style=3D"background-color: #FFFFFF; padding: 0; border: =
1181 0 solid #0096d6;" align=3D"center" valign=3D"top" bgcolor=3D"#FFFFFF"> <tab=
1182 le class=3D"layout layout--1-column" style=3D"table-layout: fixed;" width=
1183 =3D"100%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0"> <tr> <td class=
1184 =3D"column column--1 scale stack" style=3D"width: 100%;" align=3D"center" v=
1185 align=3D"top"> <table class=3D"footer" width=3D"100%" border=3D"0" cellpadd=
1186 ing=3D"0" cellspacing=3D"0" style=3D"font-family: Verdana,Geneva,sans-serif=
1187 ; color: #5d5d5d; font-size: 12px;"> <tr> <td class=3D"footer_container" al=
1188 ign=3D"center"> <table class=3D"footer-container" width=3D"100%" cellpaddin=
1189 g=3D"0" cellspacing=3D"0" border=3D"0" style=3D"background-color: #ffffff; =
1190 margin-left: auto; margin-right: auto; table-layout: auto !important;" bgco=
1191 lor=3D"#ffffff">
1192 <tr>
1193 <td width=3D"100%" align=3D"center" valign=3D"top" style=3D"width: 100%;">
1194 <div class=3D"footer-max-main-width" align=3D"center" style=3D"margin-left:=
1195 auto; margin-right: auto; max-width: 100%;">
1196 <table width=3D"100%" cellpadding=3D"0" cellspacing=3D"0" border=3D"0">
1197 <tr>
1198 <td class=3D"footer-layout" align=3D"center" valign=3D"top" style=3D"paddin=
1199 g: 16px 0px;">
1200 <table class=3D"footer-main-width" style=3D"width: 580px;" border=3D"0" cel=
1201 lpadding=3D"0" cellspacing=3D"0">
1202 <tr>
1203 <td class=3D"footer-text" align=3D"center" valign=3D"top" style=3D"color: #=
1204 5d5d5d; font-family: Verdana,Geneva,sans-serif; font-size: 12px; padding: 4=
1205 px 0px;">
1206 <span class=3D"footer-column">spamspam Loan Servicing<span class=3D"footer-=
1207 mobile-hidden"> | </span></span><span class=3D"footer-column">4425 Ponce de=
1208 Leon Blvd 5-251<span class=3D"footer-mobile-hidden">, </span></span><span =
1209 class=3D"footer-column"></span><span class=3D"footer-column"></span><span c=
1210 lass=3D"footer-column">Coral Gables, FL 33146-1837</span><span class=3D"foo=
1211 ter-column"></span>
1212 </td>
1213 </tr>
1214 <tr>
1215 <td class=3D"footer-row" align=3D"center" valign=3D"top" style=3D"padding: =
1216 10px 0px;">
1217 <table cellpadding=3D"0" cellspacing=3D"0" border=3D"0">
1218 <tr>
1219 <td class=3D"footer-text" align=3D"center" valign=3D"top" style=3D"color: #=
1220 5d5d5d; font-family: Verdana,Geneva,sans-serif; font-size: 12px; padding: 4=
1221 px 0px;">
1222 <a href=3D"https://visitor.constantcontact.com/do?p=3Dun&m=3D001g3dtlqhzM3v=
1223 -44b1-be0e-f5a444cb0650" data-track=3D"false" style=3D"color: #5d5d5d;">Uns=
1224 ubscribe [email protected]<span class=3D"partnerOptOut"></span></a>
1225 <span class=3D"partnerOptOut"></span>
1226 </td>
1227 </tr>
1228 <tr>
1229 <td class=3D"footer-text" align=3D"center" valign=3D"top" style=3D"color: #=
1230 5d5d5d; font-family: Verdana,Geneva,sans-serif; font-size: 12px; padding: 4=
1231 px 0px;">
1232 <a href=3D"https://visitor.constantcontact.com/do?p=3Doo&m=3D001g3dtlqhzM3v=
1233 -44b1-be0e-f5a444cb0650" data-track=3D"false" style=3D"color: #5d5d5d;">Upd=
1234 ate Profile</a> |
1235 <a href=3D"https://spamspam.com/privacy-notice/" data-track=3D"false" style=
1236 =3D"color: #5d5d5d;">Our Privacy Policy</a><span class=3D"footer-mobile-hid=
1237 den"> |</span>
1238 <a class=3D"footer-about-provider footer-mobile-stack footer-mobile-stack-p=
1239 adding" href=3D"http://www.constantcontact.com/legal/about-constant-contact=
1240 " data-track=3D"false" style=3D"color: #5d5d5d;">Constant Contact Data Noti=
1241 ce</a>
1242 </td>
1243 </tr>
1244 <tr>
1245 <td class=3D"footer-text" align=3D"center" valign=3D"top" style=3D"color: #=
1246 5d5d5d; font-family: Verdana,Geneva,sans-serif; font-size: 12px; padding: 4=
1247 px 0px;">
1248 Sent by
1249 <a href=3D"mailto:[email protected]" style=3D"color: #5d5d5d; text-deco=
1250 ration: none;">[email protected]</a>
1251 </td>
1252 </tr>
1253 </table>
1254 </td>
1255 </tr>
1256 <tr>
1257 <td class=3D"footer-text" align=3D"center" valign=3D"top" style=3D"color: #=
1258 5d5d5d; font-family: Verdana,Geneva,sans-serif; font-size: 12px; padding: 4=
1259 px 0px;">
1260 </td>
1261 </tr>
1262 </table>
1263 </td>
1264 </tr>
1265 </table>
1266 </div>
1267 </td>
1268 </tr>
1269 </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> =
1270 </td> </tr> </table> </td> </tr> </table> </div> </body> </html>
1271
1272 ------=_Part_75055660_144854819.1698672187348--
1273 .
1274 `
1275
1276 func TestSmtpBackend_Spam_Text(t *testing.T) {
1277 email := spamEmail
1278 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
1279 require.Equal(t, "/mytopic", r.URL.Path)
1280 require.Equal(t, "Buying a home? You deserve the confidence of Pre-Approval", r.Header.Get("Title"))
1281 actual := readAll(t, r.Body)
1282 expected := "When you're buying a home, Pre-Approval gives you confidence you're in the right price range and shows sellers you mean business. xxxxxxxxx SELLING or BUYING? Call: 844-590-2275 Get Your Homebuying PRE-APPROVAL IN 24-HOURS* Get Pre-Approved When you're buying a home, Pre-Approval gives you confidence you're in the right price range and shows sellers you mean business. xxxxxxxxxGet Pre-Approved today! Click or Call to Get Pre-Approved 844-590-2275 Get Pre-Approved nmlsconsumeraccess.org/ *The 24 hour timeframe is for most approvals, however if additional information is needed or a request is on a holiday, the time for preapproval may be greater than 24 hours. This email is for informational purposes only and is not an offer, loan approval or loan commitment. Mortgage rates are subject to change without notice. Some terms and restrictions may apply to certain loan programs. Refinancing existing loans may result in total finance charges being higher over the life of the loan, reduction in payments may partially reflect a longer loan term. This information is provided as guidance and illustrative purposes only and does not constitute legal or financial advice. We are not liable or bound legally for any answers provided to any user for our process or position on an issue. This information may change from time to time and at any time without notification. The most current information will be updated periodically and posted in the online forum. spamspam Loan Servicing, LLC. NMLS#391521. nmlsconsumeraccess.org. You are receiving this information as a current loan customer with spamspam Loan Servicing, LLC. Not licensed for lending activities in any of the U.S. territories. Not authorized to originate loans in the State of New York. Licensed by the Dept. of Financial Protection and Innovation under the California Residential Mortgage .Lending Act #4131216. This email was sent to [email protected] Version 103023PCHPrAp9 xxxxxxxxx spamspam Loan Servicing | 4425 Ponce de Leon Blvd 5-251, Coral Gables, FL 33146-1837 Unsubscribe [email protected] Update Profile | Our Privacy Policy | Constant Contact Data Notice Sent by [email protected]"
1283 require.Equal(t, expected, actual)
1284 })
1285 defer s.Close()
1286 defer c.Close()
1287 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
1288 }
1289
1290 func TestSmtpBackend_Spam_HTML(t *testing.T) {
1291 email := strings.ReplaceAll(spamEmail, "text/plain", "text/not-plain-anymore") // We artificially force HTML parsing here
1292 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
1293 require.Equal(t, "/mytopic", r.URL.Path)
1294 require.Equal(t, "Buying a home? You deserve the confidence of Pre-Approval", r.Header.Get("Title"))
1295 actual := readAll(t, r.Body)
1296 expected := `When you&#39;re buying a home, Pre-Approval gives you confidence you&#39;re in the right price range and shows sellers you mean business.
1297 ` + "\u200a" + `
1298
1299 SELLING or BUYING?
1300 Call: 844-590-2275
1301
1302 Get Your Homebuying
1303 PRE-APPROVAL IN 24-HOURS *
1304 Get Pre-Approved
1305
1306 When you&#39;re buying a home, Pre-Approval gives you confidence you&#39;re in the right price range and shows sellers you mean business.
1307 ` + "\ufeff" + `Get Pre-Approved today!
1308
1309 Click or Call to Get Pre-Approved
1310 844-590-2275
1311 Get Pre-Approved
1312
1313 nmlsconsumeraccess.org/
1314 *The 24 hour timeframe is for most approvals, however if additional information is needed or a request is on a holiday, the time for preapproval may be greater than 24 hours.
1315 This email is for informational purposes only and is not an offer, loan approval or loan commitment. Mortgage rates are subject to change without notice. Some terms and restrictions may apply to certain loan programs Refinancing existing loans may result in total finance charges being higher over the life of the loan, reduction in payments may partially reflect a longer loan term. This information is provided as guidance and illustrative purposes only and does not constitute legal or financial advice. We are not liable or bound legally for any answers provided to any user for our process or position on an issue. This information may change from time to time and at any time without notification. The most current information will be updated periodically and posted in the online forum.
1316 spamspam Loan Servicing, LLC. NMLS#391521. nmlsconsumeraccess.org. You are receiving this information as a current loan customer with spamspam Loan Servicing, LLC. Not licensed for lending activities in any of the U.S. territories. Not authorized to originate loans in the State of New York. Licensed by the Dept. of Financial Protection and Innovation under the California Residential Mortgage .Lending Act #4131216.
1317
1318 This email was sent to [email protected]
1319 Version 103023PCHPrAp9
1320 ` + "\ufeff" + `
1321
1322 spamspam Loan Servicing | 4425 Ponce de Leon Blvd 5-251 , Coral Gables, FL 33146-1837
1323
1324 Unsubscribe [email protected]
1325
1326 Update Profile |
1327 Our Privacy Policy |
1328 Constant Contact Data Notice
1329
1330 Sent by
1331 [email protected]`
1332 require.Equal(t, expected, actual)
1333 })
1334 defer s.Close()
1335 defer c.Close()
1336 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
1337 }
1338
1339 func TestSmtpBackend_HTMLOnly_FromDiskStation(t *testing.T) {
1340 email := `EHLO example.com
1341 MAIL FROM: [email protected]
1342 RCPT TO: [email protected]
1343 DATA
1344 From: "=?UTF-8?B?Um9iYmll?=" <[email protected]>
1345 To: <[email protected]>
1346 Message-Id: <[email protected]>
1347 MIME-Version: 1.0
1348 Subject: =?UTF-8?B?W1N5bm9sb2d5IE5BU10gVGVzdCBNZXNzYWdlIGZyb20gTGl0dHNfTkFT?=
1349 Content-Type: text/html; charset=utf-8
1350 Content-Transfer-Encoding: 8bit
1351
1352 Congratulations! You have successfully set up the email notification on Synology_NAS.<BR>For further system configurations, please visit http://192.168.1.28:5000/, http://172.16.60.5:5000/.<BR>(If you cannot connect to the server, please contact the administrator.)<BR><BR>From Synology_NAS<BR><BR><BR>
1353 .
1354 `
1355 s, c, conf, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
1356 require.Equal(t, "/synology", r.URL.Path)
1357 require.Equal(t, "[Synology NAS] Test Message from Litts_NAS", r.Header.Get("Title"))
1358 expected := "Congratulations! You have successfully set up the email notification on Synology_NAS.\n" +
1359 "For further system configurations, please visit http://192.168.1.28:5000/, http://172.16.60.5:5000/.\n" +
1360 "(If you cannot connect to the server, please contact the administrator.)\n\n" +
1361 "From Synology_NAS"
1362 require.Equal(t, expected, readAll(t, r.Body))
1363 })
1364 conf.SMTPServerDomain = "mydomain.me"
1365 conf.SMTPServerAddrPrefix = ""
1366 defer s.Close()
1367 defer c.Close()
1368 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
1369 }
1370
1371 func TestSmtpBackend_HTMLEmail_BrTagsPreserved(t *testing.T) {
1372 email := `EHLO example.com
1373 MAIL FROM: [email protected]
1374 RCPT TO: [email protected]
1375 DATA
1376 Content-Type: text/html; charset=utf-8
1377 Content-Transfer-Encoding: 8bit
1378 Subject: Task Scheduler: daily-backup
1379
1380 Task Scheduler has completed a scheduled task.<BR><BR>Task: daily-backup<BR>Start time: Mon, 01 Jan 2026 02:00:00 +0000<BR>Stop time: Mon, 01 Jan 2024 02:03:00 +0000<BR>Current status: 0 (Normal)<BR>Standard output/error:<BR>OK<BR><BR>From MyNAS
1381 .
1382 `
1383 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
1384 require.Equal(t, "/alerts", r.URL.Path)
1385 require.Equal(t, "Task Scheduler: daily-backup", r.Header.Get("Title"))
1386 expected := "Task Scheduler has completed a scheduled task.\n\n" +
1387 "Task: daily-backup\n" +
1388 "Start time: Mon, 01 Jan 2026 02:00:00 +0000\n" +
1389 "Stop time: Mon, 01 Jan 2024 02:03:00 +0000\n" +
1390 "Current status: 0 (Normal)\n" +
1391 "Standard output/error:\n" +
1392 "OK\n\n" +
1393 "From MyNAS"
1394 require.Equal(t, expected, readAll(t, r.Body))
1395 })
1396 defer s.Close()
1397 defer c.Close()
1398 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
1399 }
1400
1401 func TestSmtpBackend_PlaintextWithToken(t *testing.T) {
1402 email := `EHLO example.com
1403 MAIL FROM: [email protected]
1404 RCPT TO: [email protected]
1405 DATA
1406 Subject: Very short mail
1407
1408 what's up
1409 .
1410 `
1411 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
1412 require.Equal(t, "/mytopic", r.URL.Path)
1413 require.Equal(t, "Very short mail", r.Header.Get("Title"))
1414 require.Equal(t, "Bearer tk_KLORUqSqvNRLpY11DfkHVbHu9NGG2", r.Header.Get("Authorization"))
1415 require.Equal(t, "what's up", readAll(t, r.Body))
1416 })
1417 defer s.Close()
1418 defer c.Close()
1419 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
1420 }
1421
1422 func TestSmtpBackend_PlaintextWithPlainAuth(t *testing.T) {
1423 email := `EHLO example.com
1424 AUTH PLAIN dGVzdAB0ZXN0ADEyMzQ=
1425 MAIL FROM: [email protected]
1426 RCPT TO: [email protected]
1427 DATA
1428 Subject: Very short mail
1429
1430 what's up
1431 .
1432 `
1433 s, c, _, scanner := newTestSMTPServer(t, func(w http.ResponseWriter, r *http.Request) {
1434 require.Equal(t, "/mytopic", r.URL.Path)
1435 require.Equal(t, "Very short mail", r.Header.Get("Title"))
1436 require.Equal(t, "Basic dGVzdDoxMjM0", r.Header.Get("Authorization"))
1437 require.Equal(t, "what's up", readAll(t, r.Body))
1438 })
1439 defer s.Close()
1440 defer c.Close()
1441 writeAndReadUntilLine(t, email, c, scanner, "250 2.0.0 OK: queued")
1442 }
1443
1444 type smtpHandlerFunc func(http.ResponseWriter, *http.Request)
1445
1446 func newTestSMTPServer(t *testing.T, handler smtpHandlerFunc) (s *smtp.Server, c net.Conn, conf *Config, scanner *bufio.Scanner) {
1447 conf = newTestConfig(t, "")
1448 conf.SMTPServerListen = ":25"
1449 conf.SMTPServerDomain = "ntfy.sh"
1450 conf.SMTPServerAddrPrefix = "ntfy-"
1451 backend := newMailBackend(conf, handler)
1452 l, err := net.Listen("tcp", "127.0.0.1:0")
1453 if err != nil {
1454 t.Fatal(err)
1455 }
1456 s = smtp.NewServer(backend)
1457 s.Domain = conf.SMTPServerDomain
1458 s.AllowInsecureAuth = true
1459 go func() {
1460 require.Nil(t, s.Serve(l))
1461 }()
1462 c, err = net.Dial("tcp", l.Addr().String())
1463 if err != nil {
1464 t.Fatal(err)
1465 }
1466 scanner = bufio.NewScanner(c)
1467 return
1468 }
1469
1470 func writeAndReadUntilLine(t *testing.T, email string, conn net.Conn, scanner *bufio.Scanner, expectedLine string) {
1471 _, err := io.WriteString(conn, email)
1472 require.Nil(t, err)
1473 readUntilLine(t, conn, scanner, expectedLine)
1474 }
1475
1476 func readUntilLine(t *testing.T, conn net.Conn, scanner *bufio.Scanner, expectedLine string) {
1477 cancelChan := make(chan bool)
1478 go func() {
1479 select {
1480 case <-cancelChan:
1481 case <-time.After(3 * time.Second):
1482 conn.Close()
1483 t.Error("Failed waiting for expected output")
1484 }
1485 }()
1486 var output string
1487 for scanner.Scan() {
1488 text := scanner.Text()
1489 if strings.TrimSpace(text) == expectedLine {
1490 cancelChan <- true
1491 return
1492 }
1493 output += text + "\n"
1494 }
1495 t.Fatalf("Expected line '%s' not found in output:\n%s", expectedLine, output)
1496 }