File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ A template is provided:
20
20
- Indicate if changes are major, minor, or patch changes.
21
21
```
22
22
23
+ ## 0.5.0.1
24
+ - [ #39 ] ( https://github.com/jhickner/smtp-mail/pull/39 ) @spencerjanssen
25
+ - The ` Bcc ` field is stripped from the message before sending to the SMTP
26
+ server. This is to prevent leaking the BCC contents to recipients.
27
+
23
28
## 0.5.0.0
24
29
25
30
- Adds support for OAuth authentication with a new function ` sendMailWithLoginOAuthSTARTTLS ` .
Original file line number Diff line number Diff line change @@ -326,12 +326,15 @@ sendRenderedMail sender receivers dat conn = do
326
326
-- 'SMTPConnection'
327
327
renderAndSend :: SMTPConnection -> Mail -> IO ()
328
328
renderAndSend conn mail@ Mail {.. } = do
329
- rendered <- lazyToStrict `fmap` renderMail' mail
329
+ rendered <- lazyToStrict `fmap` renderMail' (removeBcc mail)
330
330
sendRenderedMail from to rendered conn
331
331
where enc = encodeUtf8 . addressEmail
332
332
from = enc mailFrom
333
333
to = map enc $ mailTo ++ mailCc ++ mailBcc
334
334
335
+ removeBcc :: Mail -> Mail
336
+ removeBcc mail = mail {mailBcc = [] }
337
+
335
338
sendMailOnConnection :: Mail -> SMTPConnection -> IO ()
336
339
sendMailOnConnection mail con = do
337
340
renderAndSend con mail
@@ -436,7 +439,7 @@ sendMailWithSenderIntern sender mail con = do
436
439
437
440
renderAndSendFrom :: ByteString -> SMTPConnection -> Mail -> IO ()
438
441
renderAndSendFrom sender conn mail@ Mail {.. } = do
439
- rendered <- BL. toStrict `fmap` renderMail' mail
442
+ rendered <- BL. toStrict `fmap` renderMail' (removeBcc mail)
440
443
sendRenderedMail sender to rendered conn
441
444
where enc = encodeUtf8 . addressEmail
442
445
to = map enc $ mailTo ++ mailCc ++ mailBcc
Original file line number Diff line number Diff line change 1
1
name : smtp-mail
2
- version : 0.5.0.0
2
+ version : 0.5.0.1
3
3
synopsis : Simple email sending via SMTP
4
4
description : This packages provides a simple interface for mail over SMTP. Please see the README for more information.
5
5
homepage : http://github.com/haskell-github-trust/smtp-mail
You can’t perform that action at this time.
0 commit comments