JAMES-2258 Inlined attachment should consider as false when no Content-ID
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/0028797d Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/0028797d Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/0028797d Branch: refs/heads/master Commit: 0028797d9362e2d334d706c90a89ea2425427909 Parents: e456bf7 Author: quynhn <qngu...@linagora.com> Authored: Fri Dec 15 10:04:48 2017 +0700 Committer: quynhn <qngu...@linagora.com> Committed: Fri Dec 15 10:04:48 2017 +0700 ---------------------------------------------------------------------- .../cucumber/GetMessagesMethodStepdefs.java | 7 ++- .../test/resources/cucumber/GetMessages.feature | 14 +++++ .../resources/eml/inlinedWithoutContentID.eml | 60 ++++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/0028797d/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java index 0e51707..755b3ff 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/GetMessagesMethodStepdefs.java @@ -329,10 +329,15 @@ public class GetMessagesMethodStepdefs { } @Given("^\"([^\"]*)\" has a message \"([^\"]*)\" in the \"([^\"]*)\" mailbox with inlined attachments without content disposition$") - public void test(String username, String messageName, String mailbox) throws Exception { + public void appendMessageWithInlinedImageButNoContentDisposition(String username, String messageName, String mailbox) throws Exception { userStepdefs.execWithUser(username, () -> appendMessage(messageName, mailbox, "eml/inlinedWithoutContentDisposition.eml")); } + @Given("^\"([^\"]*)\" has a message \"([^\"]*)\" in the \"([^\"]*)\" mailbox with inlined image without content ID$") + public void appendMessageWithInlinedImageButNoContentID(String username, String messageName, String mailbox) throws Exception { + userStepdefs.execWithUser(username, () -> appendMessage(messageName, mailbox, "eml/inlinedWithoutContentID.eml")); + } + @Given("^\"([^\"]*)\" has a message \"([^\"]*)\" in \"([^\"]*)\" mailbox with specific charset$") public void appendMessageWithSpecificCharset(String username, String messageName, String mailbox) throws Throwable { userStepdefs.execWithUser(username, () -> appendMessageWithSpecificCharset(messageName, mailbox)); http://git-wip-us.apache.org/repos/asf/james-project/blob/0028797d/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 9d79b44..cb4c951 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 @@ -408,3 +408,17 @@ Feature: GetMessages method |cid |null | |name |"encrypted.asc" | |isInline |false | + + Scenario: Retrieving message should be possible when message with inlined attachment but without content ID + Given "al...@domain.tld" has a message "m1" in the "INBOX" mailbox with inlined image without content ID + When "al...@domain.tld" ask for messages "m1" + Then no error is returned + And the list should contain 1 message + And the hasAttachment of the message is "true" + And the list of attachments of the message contains 1 attachments + And the first attachment is: + |key | value | + |type |"image/jpeg" | + |cid |null | + |name |"IMG_6112.JPG" | + |isInline |false | http://git-wip-us.apache.org/repos/asf/james-project/blob/0028797d/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/inlinedWithoutContentID.eml ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/inlinedWithoutContentID.eml b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/inlinedWithoutContentID.eml new file mode 100644 index 0000000..6ea2375 --- /dev/null +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/resources/eml/inlinedWithoutContentID.eml @@ -0,0 +1,60 @@ +Return-Path: <u...@localhost.com> +Received: from localhost +X-Sieve: CMU Sieve 2.4 +X-Virus-Scanned: Debian amavisd-new at localhost.com +X-Spam-Flag: NO +X-Spam-Score: -1.289 +X-Spam-Level: +Content-Type: multipart/mixed; boundary=Apple-Mail-E1D6D861-D1AD-47F9-A403-F2AA32CC52CC +Content-Transfer-Encoding: 7bit +From: Sender <f...@localhost.com> +Mime-Version: 1.0 (1.0) +Date: Mon, 11 Dec 2017 22:06:42 +0100 +Subject: Inlined Photos +Message-Id: <sen...@localhost.com> +X-Mailer: iPhone Mail (14G60) + + +--Apple-Mail-E1D6D861-D1AD-47F9-A403-F2AA32CC52CC +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit + + + + +--Apple-Mail-E1D6D861-D1AD-47F9-A403-F2AA32CC52CC +Content-Type: image/jpeg; + name=IMG_6112.JPG; + x-apple-part-url=B11616AF-86EB-47AF-863A-176A823498DB +Content-Disposition: inline; + filename=IMG_6112.JPG +Content-Transfer-Encoding: base64 + +/9j/4QZIRXhpZgAATU0AKgAAAAgACgEPAAIAAAAGAAAAhgEQAAIAAAAJAAAAjAESAAMAAAABAAYA +AAEaAAUAAAABAAAAlgEbAAUAAAABAAAAngEoAAMAAAABAAIAAAExAAIAAAAHAAAApgEyAAIAAAAU +AAAArgITAAMAAAABAAEAAIdpAAQAAAABAAAAwgAAAABBcHBsZQBpUGhvbmUgNgAAAAAASAAAAAEA +AABIAAAAATEwLjMuMwAAMjAxNzoxMjoxMSAxODowN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AhABYAEgARACQAyAD3AJkBrAGdARkB +JwELAQYBMAAYACkAGAAaACMADwB7ANoANQGvAZUBYgEkAUgBWQF3ABMANABWALkAKgH1ANQA7gAy +VNRXU//Z +--Apple-Mail-E1D6D861-D1AD-47F9-A403-F2AA32CC52CC +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +-- +Sender +--Apple-Mail-E1D6D861-D1AD-47F9-A403-F2AA32CC52CC-- \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org