Repository: james-project
Updated Branches:
  refs/heads/master 9d3bbbd31 -> af726bbb9


JAMES-2258 inline should be false in case of no Content-ID for inlined 
attachment


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/e456bf7e
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/e456bf7e
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/e456bf7e

Branch: refs/heads/master
Commit: e456bf7e000c9f5dc05bfc4d1f689d0f34c5c06f
Parents: 8e9c667
Author: quynhn <qngu...@linagora.com>
Authored: Wed Dec 13 17:51:31 2017 +0700
Committer: quynhn <qngu...@linagora.com>
Committed: Wed Dec 13 17:51:31 2017 +0700

----------------------------------------------------------------------
 .../james/mailbox/store/mail/model/impl/MessageParser.java   | 2 +-
 .../src/test/resources/cucumber/GetMessages.feature          | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/e456bf7e/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageParser.java
----------------------------------------------------------------------
diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageParser.java
 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageParser.java
index d447b20..3331b7b 100644
--- 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageParser.java
+++ 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageParser.java
@@ -130,7 +130,7 @@ public class MessageParser {
         Optional<String> contentType = contentType(contentTypeField);
         Optional<String> name = name(contentTypeField, 
contentDispositionField);
         Optional<Cid> cid = cid(readHeader(entity, CONTENT_ID, 
ContentIdField.class));
-        boolean isInline = isInline(readHeader(entity, CONTENT_DISPOSITION, 
ContentDispositionField.class));
+        boolean isInline = isInline(readHeader(entity, CONTENT_DISPOSITION, 
ContentDispositionField.class)) && cid.isPresent();
 
         return MessageAttachment.builder()
                 .attachment(Attachment.builder()

http://git-wip-us.apache.org/repos/asf/james-project/blob/e456bf7e/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature
----------------------------------------------------------------------
diff --git 
a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature
 
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature
index 11dde7a..9d79b44 100644
--- 
a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature
+++ 
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/cucumber/GetMessages.feature
@@ -276,9 +276,9 @@ Feature: GetMessages method
     And the list of attachments of the message contains 1 attachments
     And the first attachment is:
       |key      | value                                     |
-      |type     |"application/pdf"                               |
+      |type     |"application/pdf"                          |
       |cid      |null                                       |
-      |isInline |true                                      |
+      |isInline |false                                      |
 
   Scenario: Retrieving message with inline attachment and blank CID should 
convert that inlined attachment to normal attachment
     Given "al...@domain.tld" has a message "m1" in "INBOX" mailbox with inline 
attachment and blank CID
@@ -291,7 +291,7 @@ Feature: GetMessages method
         |key      | value            |
         |type     |"application/pdf" |
         |cid      |null              |
-        |isInline |true              |
+        |isInline |false             |
 
   Scenario: Preview should be computed even when HTML body contains many tags 
without content
     Given "al...@domain.tld" has a message "m1" in "INBOX" mailbox with HTML 
body with many empty tags
@@ -407,4 +407,4 @@ Feature: GetMessages method
       |type     |"application/octet-stream"    |
       |cid      |null                          |
       |name     |"encrypted.asc"               |
-      |isInline |true                          |
+      |isInline |false                         |


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to