Skip to content

Commit

Permalink
Respect custom Message-IDs in JavaMail backend
Browse files Browse the repository at this point in the history
Currently the JavaMail backend is hardcoded to ignore a custom MessageId such as the one below:

```scala
MailBuilder.build(
  From("[email protected]"),
  To("[email protected]"),
  MessageID(s"<[email protected]>"),
  Subject("Hello!"),
  TextBody("Hello!"),
)
```
  • Loading branch information
edwardcwang authored Feb 17, 2022
1 parent 43f5e1d commit 3da9780
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object SendMail {
logger.debugF(s"Sending ${mails.size} mail(s) using ${conn.config}") *>
mails.traverse { mail =>
ThreadClassLoader {
cm.convert(conn.session, MessageIdEncode.Random, mail).flatMap { msg =>
cm.convert(conn.session, MessageIdEncode.GivenOrRandom, mail).flatMap { msg =>
val msgId = checkMessageID(msg)
Sync[F].blocking {
logger.debug(s"Sending message: ${infoLine(mail.header)}, $msgId")
Expand Down

0 comments on commit 3da9780

Please sign in to comment.