You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/03/23 08:33:34 UTC

[james-project] branch master updated: JAMES-3439 Email/set create should encode attachments in base64

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
     new 8fa134b  JAMES-3439 Email/set create should encode attachments in base64
8fa134b is described below

commit 8fa134b1f170f0b2a78de637517f5ff838f552bf
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Mar 23 09:42:08 2022 +0700

    JAMES-3439 Email/set create should encode attachments in base64
    
    Failure to do so will cause invalid characters to be present,
    preventing SMTP transmition.
    
    ```
    host x.x.x.x[x.x.x.x] said: 554 5.6.0
        Message contains NUL characters (in reply to end of DATA command)
    ```
---
 .../src/main/scala/org/apache/james/jmap/mail/EmailSet.scala             | 1 +
 1 file changed, 1 insertion(+)

diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/EmailSet.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/EmailSet.scala
index 9fd289d..a0159f4 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/EmailSet.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/EmailSet.scala
@@ -249,6 +249,7 @@ case class EmailCreationRequest(mailboxIds: MailboxIds,
     bodypartBuilder.setBody(loadedAttachment.content, attachment.`type`.value)
       .setField(contentTypeField(attachment, blob))
       .setContentDisposition(attachment.disposition.getOrElse(Disposition.ATTACHMENT).value)
+      .setContentTransferEncoding("base64")
     attachment.cid.map(_.asField).foreach(bodypartBuilder.addField)
     attachment.location.map(_.asField).foreach(bodypartBuilder.addField)
     attachment.language.map(_.asField).foreach(bodypartBuilder.addField)

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org