From dda39e8a221f3bd0fe7715e1cc206ba3cf9f6040 Mon Sep 17 00:00:00 2001 From: Odunayo Ogungbure Date: Wed, 16 Sep 2026 22:10:09 +0100 Subject: [PATCH 1/3] MSD-15032: Add exclude_attachments to the inbound route builder Adds excludeAttachments() to InboundRouteBuilder and the field to the route response model, and documents it in the README. The builder body holds a boxed Boolean so an unset value is omitted from the request: the API rejects an explicit null, and omitting the key on update keeps the route's stored value. Also adds exclude_attachments to the recorded inbound route responses so the fixtures match the shape the API now returns. The request hashes the fixtures are keyed by are unchanged. The forwarding behaviour is not implemented in the API yet, so this must not be released until that change ships. Co-Authored-By: Claude Opus 5 --- README.md | 6 ++++++ .../sdk/inboundroutes/InboundRoute.java | 3 +++ .../sdk/inboundroutes/InboundRouteBuilder.java | 15 +++++++++++++++ .../inboundroutes/InboundRouteBuilderBody.java | 8 ++++++++ .../InboundRoutesTest_AddInboundRouteTest().json | 2 +- ...InboundRoutesTest_InboundRoutesListTest().json | 2 +- ...nboundRoutesTest_SingleInboundRouteTest().json | 2 +- ...nboundRoutesTest_UpdateInboundRouteTest().json | 2 +- ...t_required_when_domain_enabled_is_false().json | 2 +- 9 files changed, 37 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b82fb5a..5df198e 100644 --- a/README.md +++ b/README.md @@ -908,6 +908,8 @@ public void getInboundRoute() { ### Create an inbound route +Call `excludeAttachments(true)` to drop attachments from the message before it is forwarded. It defaults to `false`. Inline (CID) parts count as attachments, so images embedded in an HTML body are dropped too. + ```java import com.mailersend.sdk.MailerSend; import com.mailersend.sdk.exceptions.MailerSendException; @@ -932,6 +934,7 @@ public void createInboundRoute() { .domainEnabled(false) .matchFilter("match_all") .forwards(new Forward[] { forward }) + .excludeAttachments(true) .addRoute(); } catch (MailerSendException e) { @@ -944,6 +947,8 @@ public void createInboundRoute() { ### Update an inbound route +Leaving `excludeAttachments()` unset keeps the route's stored value; the API does not reset it to `false`. Pass `false` explicitly to turn it off. + ```java import com.mailersend.sdk.MailerSend; import com.mailersend.sdk.exceptions.MailerSendException; @@ -969,6 +974,7 @@ public void updateInboundRoute() { .domainEnabled(false) .matchFilter("match_all") .forwards(new Forward[] { forward }) + .excludeAttachments(false) .updateRoute("inbound route id"); System.out.println(route.id); diff --git a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRoute.java b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRoute.java index d5a90a4..61881a8 100644 --- a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRoute.java +++ b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRoute.java @@ -47,6 +47,9 @@ public class InboundRoute { @SerializedName("priority") public int priority; + @SerializedName("exclude_attachments") + public boolean excludeAttachments; + /** *

postDeserialize.

diff --git a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java index ea8ce01..758fe44 100644 --- a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java +++ b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java @@ -189,6 +189,21 @@ public InboundRouteBuilder forwards(Forward[] forwards) { builderBody.forwards = forwards; return this; } + + /** + *

excludeAttachments.

+ * + *

Drops attachments from the message before it is forwarded. Defaults to {@code false}. + * Inline (CID) parts count as attachments, so images embedded in an HTML body are dropped + * too. Leaving this unset on an update keeps the route's stored value.

+ * + * @param excludeAttachments a boolean. + * @return a {@link com.mailersend.sdk.inboundroutes.InboundRouteBuilder} object. + */ + public InboundRouteBuilder excludeAttachments(boolean excludeAttachments) { + builderBody.excludeAttachments = excludeAttachments; + return this; + } private static final String[] VALID_CATCH_FILTER_TYPES = {"catch_all", "catch_recipient"}; diff --git a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilderBody.java b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilderBody.java index 82df048..53607a9 100644 --- a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilderBody.java +++ b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilderBody.java @@ -55,6 +55,13 @@ public class InboundRouteBuilderBody { @SerializedName("forwards") public Forward[] forwards; + /** + * Optional. Boxed so an unset value is omitted from the request body: the API keeps + * the route's stored value when the key is absent, and rejects an explicit null. + */ + @SerializedName("exclude_attachments") + public Boolean excludeAttachments; + /** *

reset.

*/ @@ -71,5 +78,6 @@ public void reset() { matchFilter = null; matchType = null; forwards = null; + excludeAttachments = null; } } diff --git a/src/test/resources/fixtures/InboundRoutesTest_AddInboundRouteTest().json b/src/test/resources/fixtures/InboundRoutesTest_AddInboundRouteTest().json index b8aec1f..d183180 100644 --- a/src/test/resources/fixtures/InboundRoutesTest_AddInboundRouteTest().json +++ b/src/test/resources/fixtures/InboundRoutesTest_AddInboundRouteTest().json @@ -1 +1 @@ -{"b8a0377fe05e24ddd4159a4076934d0e3fb8dad1":{"body":"{\"data\":{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example-domain.com\",\"secret\":\"FRwZFJCkf7nbydrn0oq9uLc76USD4iaI\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"}}}","headers":{":status":["201"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3b22358826f68-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:49:26 GMT"],"expect-ct":["max-age\u003d604800, report-uri\u003d\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age\u003d15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["57"]},"statusCode":201}} \ No newline at end of file +{"b8a0377fe05e24ddd4159a4076934d0e3fb8dad1":{"body":"{\"data\":{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example-domain.com\",\"secret\":\"FRwZFJCkf7nbydrn0oq9uLc76USD4iaI\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false}}","headers":{":status":["201"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3b22358826f68-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:49:26 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["57"]},"statusCode":201}} \ No newline at end of file diff --git a/src/test/resources/fixtures/InboundRoutesTest_InboundRoutesListTest().json b/src/test/resources/fixtures/InboundRoutesTest_InboundRoutesListTest().json index b369c97..c1d7cf8 100644 --- a/src/test/resources/fixtures/InboundRoutesTest_InboundRoutesListTest().json +++ b/src/test/resources/fixtures/InboundRoutesTest_InboundRoutesListTest().json @@ -1 +1 @@ -{"da3edc8bde57193e98e999a2ac1899738b69b5b5":{"body":"{\"data\":[{\"id\":\"x3vz9dleq7lkj50y\",\"name\":\"test\",\"address\":\"fqs5shof9gvwsxs7hwaz@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/api-003.mailerlite.dev\",\"secret\":\"yAI5fwx9hR0K4gzeOxW6YBrMcoHtLtoc\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"}},{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Test inbound name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"}},{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example-domain.com\",\"secret\":\"FRwZFJCkf7nbydrn0oq9uLc76USD4iaI\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"}}],\"links\":{\"first\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page\u003d1\",\"last\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page\u003d1\",\"prev\":null,\"next\":null},\"meta\":{\"current_page\":1,\"from\":1,\"last_page\":1,\"links\":[{\"url\":null,\"label\":\"\u0026laquo; Previous\",\"active\":false},{\"url\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page\u003d1\",\"label\":\"1\",\"active\":true},{\"url\":null,\"label\":\"Next \u0026raquo;\",\"active\":false}],\"path\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound\",\"per_page\":25,\"to\":3,\"total\":3}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3b63a9a016f5f-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:52:14 GMT"],"expect-ct":["max-age\u003d604800, report-uri\u003d\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age\u003d15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file +{"da3edc8bde57193e98e999a2ac1899738b69b5b5":{"body":"{\"data\":[{\"id\":\"x3vz9dleq7lkj50y\",\"name\":\"test\",\"address\":\"fqs5shof9gvwsxs7hwaz@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/api-003.mailerlite.dev\",\"secret\":\"yAI5fwx9hR0K4gzeOxW6YBrMcoHtLtoc\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false},{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Test inbound name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false},{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example-domain.com\",\"secret\":\"FRwZFJCkf7nbydrn0oq9uLc76USD4iaI\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false}],\"links\":{\"first\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page=1\",\"last\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page=1\",\"prev\":null,\"next\":null},\"meta\":{\"current_page\":1,\"from\":1,\"last_page\":1,\"links\":[{\"url\":null,\"label\":\"« Previous\",\"active\":false},{\"url\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page=1\",\"label\":\"1\",\"active\":true},{\"url\":null,\"label\":\"Next »\",\"active\":false}],\"path\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound\",\"per_page\":25,\"to\":3,\"total\":3}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3b63a9a016f5f-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:52:14 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file diff --git a/src/test/resources/fixtures/InboundRoutesTest_SingleInboundRouteTest().json b/src/test/resources/fixtures/InboundRoutesTest_SingleInboundRouteTest().json index 13f8104..fa32b3c 100644 --- a/src/test/resources/fixtures/InboundRoutesTest_SingleInboundRouteTest().json +++ b/src/test/resources/fixtures/InboundRoutesTest_SingleInboundRouteTest().json @@ -1 +1 @@ -{"981d4a16b72bd8c0fba5563dabfb4f5498c48ae9":{"body":"{\"data\":{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Test inbound name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"}}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3ba6eded638c9-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:55:06 GMT"],"expect-ct":["max-age\u003d604800, report-uri\u003d\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age\u003d15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file +{"981d4a16b72bd8c0fba5563dabfb4f5498c48ae9":{"body":"{\"data\":{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Test inbound name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3ba6eded638c9-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:55:06 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file diff --git a/src/test/resources/fixtures/InboundRoutesTest_UpdateInboundRouteTest().json b/src/test/resources/fixtures/InboundRoutesTest_UpdateInboundRouteTest().json index fe90a6c..c966635 100644 --- a/src/test/resources/fixtures/InboundRoutesTest_UpdateInboundRouteTest().json +++ b/src/test/resources/fixtures/InboundRoutesTest_UpdateInboundRouteTest().json @@ -1 +1 @@ -{"1aff61f4d4446105b742718ccb14f912cd075602":{"body":"{\"data\":{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Updated route name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"}}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3bf27ad6238d6-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:58:19 GMT"],"expect-ct":["max-age\u003d604800, report-uri\u003d\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age\u003d15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file +{"1aff61f4d4446105b742718ccb14f912cd075602":{"body":"{\"data\":{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Updated route name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3bf27ad6238d6-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:58:19 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file diff --git a/src/test/resources/fixtures/InboundRoutesTest_inbound_domain_not_required_when_domain_enabled_is_false().json b/src/test/resources/fixtures/InboundRoutesTest_inbound_domain_not_required_when_domain_enabled_is_false().json index 2408b87..c116a59 100644 --- a/src/test/resources/fixtures/InboundRoutesTest_inbound_domain_not_required_when_domain_enabled_is_false().json +++ b/src/test/resources/fixtures/InboundRoutesTest_inbound_domain_not_required_when_domain_enabled_is_false().json @@ -1 +1 @@ -{"ad464b3b9851abf34d634bda2b845511b51fad7e":{"body":"{\"data\":{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"}}}","headers":{":status":["201"],"cache-control":["no-cache, private"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:49:26 GMT"],"server":["cloudflare"]},"statusCode":201}} \ No newline at end of file +{"ad464b3b9851abf34d634bda2b845511b51fad7e":{"body":"{\"data\":{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false}}","headers":{":status":["201"],"cache-control":["no-cache, private"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:49:26 GMT"],"server":["cloudflare"]},"statusCode":201}} \ No newline at end of file From 91f4c06432890cfa351049705bb71c4fe7e675e0 Mon Sep 17 00:00:00 2001 From: Odunayo Ogungbure Date: Wed, 23 Sep 2026 15:52:26 +0100 Subject: [PATCH 2/3] MSD-15032: Rename the option to include_attachments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UX review inverted the option: a toggle reads best when "on" means the thing in the label is happening. The field is now include_attachments, defaulting to true, so attachments are forwarded unless it is set to false. Renames the builder method, the builder body field and the response model field, and updates the README. The recorded fixtures are hand-edited rather than regenerated. VcrTape keys each response by sha1 of the request url, method and body, and no inbound test sets this field, so the request bodies and their hashes are unchanged — only the recorded response values are renamed. Co-Authored-By: Claude Opus 5 --- README.md | 8 ++++---- .../sdk/inboundroutes/InboundRoute.java | 4 ++-- .../sdk/inboundroutes/InboundRouteBuilder.java | 15 ++++++++------- .../inboundroutes/InboundRouteBuilderBody.java | 6 +++--- .../InboundRoutesTest_AddInboundRouteTest().json | 2 +- ...InboundRoutesTest_InboundRoutesListTest().json | 2 +- ...nboundRoutesTest_SingleInboundRouteTest().json | 2 +- ...nboundRoutesTest_UpdateInboundRouteTest().json | 2 +- ...t_required_when_domain_enabled_is_false().json | 2 +- 9 files changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 5df198e..4e6a366 100644 --- a/README.md +++ b/README.md @@ -908,7 +908,7 @@ public void getInboundRoute() { ### Create an inbound route -Call `excludeAttachments(true)` to drop attachments from the message before it is forwarded. It defaults to `false`. Inline (CID) parts count as attachments, so images embedded in an HTML body are dropped too. +Call `includeAttachments(false)` to drop attachments before the message is stored or forwarded. It defaults to `true`. Inline (CID) parts count as attachments, so images embedded in an HTML body are dropped too. ```java import com.mailersend.sdk.MailerSend; @@ -934,7 +934,7 @@ public void createInboundRoute() { .domainEnabled(false) .matchFilter("match_all") .forwards(new Forward[] { forward }) - .excludeAttachments(true) + .includeAttachments(false) .addRoute(); } catch (MailerSendException e) { @@ -947,7 +947,7 @@ public void createInboundRoute() { ### Update an inbound route -Leaving `excludeAttachments()` unset keeps the route's stored value; the API does not reset it to `false`. Pass `false` explicitly to turn it off. +Leaving `includeAttachments()` unset keeps the route's stored value; the API does not reset it to `true`. Pass `false` explicitly to drop attachments. ```java import com.mailersend.sdk.MailerSend; @@ -974,7 +974,7 @@ public void updateInboundRoute() { .domainEnabled(false) .matchFilter("match_all") .forwards(new Forward[] { forward }) - .excludeAttachments(false) + .includeAttachments(true) .updateRoute("inbound route id"); System.out.println(route.id); diff --git a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRoute.java b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRoute.java index 61881a8..b28e733 100644 --- a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRoute.java +++ b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRoute.java @@ -47,8 +47,8 @@ public class InboundRoute { @SerializedName("priority") public int priority; - @SerializedName("exclude_attachments") - public boolean excludeAttachments; + @SerializedName("include_attachments") + public boolean includeAttachments; /** diff --git a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java index 758fe44..9376b10 100644 --- a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java +++ b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java @@ -191,17 +191,18 @@ public InboundRouteBuilder forwards(Forward[] forwards) { } /** - *

excludeAttachments.

+ *

includeAttachments.

* - *

Drops attachments from the message before it is forwarded. Defaults to {@code false}. - * Inline (CID) parts count as attachments, so images embedded in an HTML body are dropped - * too. Leaving this unset on an update keeps the route's stored value.

+ *

Forwards attachments with the message. Defaults to {@code true}. Set it to + * {@code false} to drop them before the message is stored or forwarded; inline (CID) parts + * count as attachments, so images embedded in an HTML body are dropped too. Leaving this + * unset on an update keeps the route's stored value.

* - * @param excludeAttachments a boolean. + * @param includeAttachments a boolean. * @return a {@link com.mailersend.sdk.inboundroutes.InboundRouteBuilder} object. */ - public InboundRouteBuilder excludeAttachments(boolean excludeAttachments) { - builderBody.excludeAttachments = excludeAttachments; + public InboundRouteBuilder includeAttachments(boolean includeAttachments) { + builderBody.includeAttachments = includeAttachments; return this; } diff --git a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilderBody.java b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilderBody.java index 53607a9..150f1aa 100644 --- a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilderBody.java +++ b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilderBody.java @@ -59,8 +59,8 @@ public class InboundRouteBuilderBody { * Optional. Boxed so an unset value is omitted from the request body: the API keeps * the route's stored value when the key is absent, and rejects an explicit null. */ - @SerializedName("exclude_attachments") - public Boolean excludeAttachments; + @SerializedName("include_attachments") + public Boolean includeAttachments; /** *

reset.

@@ -78,6 +78,6 @@ public void reset() { matchFilter = null; matchType = null; forwards = null; - excludeAttachments = null; + includeAttachments = null; } } diff --git a/src/test/resources/fixtures/InboundRoutesTest_AddInboundRouteTest().json b/src/test/resources/fixtures/InboundRoutesTest_AddInboundRouteTest().json index d183180..afd487f 100644 --- a/src/test/resources/fixtures/InboundRoutesTest_AddInboundRouteTest().json +++ b/src/test/resources/fixtures/InboundRoutesTest_AddInboundRouteTest().json @@ -1 +1 @@ -{"b8a0377fe05e24ddd4159a4076934d0e3fb8dad1":{"body":"{\"data\":{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example-domain.com\",\"secret\":\"FRwZFJCkf7nbydrn0oq9uLc76USD4iaI\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false}}","headers":{":status":["201"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3b22358826f68-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:49:26 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["57"]},"statusCode":201}} \ No newline at end of file +{"b8a0377fe05e24ddd4159a4076934d0e3fb8dad1":{"body":"{\"data\":{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example-domain.com\",\"secret\":\"FRwZFJCkf7nbydrn0oq9uLc76USD4iaI\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"include_attachments\":true}}","headers":{":status":["201"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3b22358826f68-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:49:26 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["57"]},"statusCode":201}} \ No newline at end of file diff --git a/src/test/resources/fixtures/InboundRoutesTest_InboundRoutesListTest().json b/src/test/resources/fixtures/InboundRoutesTest_InboundRoutesListTest().json index c1d7cf8..6050d75 100644 --- a/src/test/resources/fixtures/InboundRoutesTest_InboundRoutesListTest().json +++ b/src/test/resources/fixtures/InboundRoutesTest_InboundRoutesListTest().json @@ -1 +1 @@ -{"da3edc8bde57193e98e999a2ac1899738b69b5b5":{"body":"{\"data\":[{\"id\":\"x3vz9dleq7lkj50y\",\"name\":\"test\",\"address\":\"fqs5shof9gvwsxs7hwaz@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/api-003.mailerlite.dev\",\"secret\":\"yAI5fwx9hR0K4gzeOxW6YBrMcoHtLtoc\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false},{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Test inbound name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false},{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example-domain.com\",\"secret\":\"FRwZFJCkf7nbydrn0oq9uLc76USD4iaI\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false}],\"links\":{\"first\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page=1\",\"last\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page=1\",\"prev\":null,\"next\":null},\"meta\":{\"current_page\":1,\"from\":1,\"last_page\":1,\"links\":[{\"url\":null,\"label\":\"« Previous\",\"active\":false},{\"url\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page=1\",\"label\":\"1\",\"active\":true},{\"url\":null,\"label\":\"Next »\",\"active\":false}],\"path\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound\",\"per_page\":25,\"to\":3,\"total\":3}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3b63a9a016f5f-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:52:14 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file +{"da3edc8bde57193e98e999a2ac1899738b69b5b5":{"body":"{\"data\":[{\"id\":\"x3vz9dleq7lkj50y\",\"name\":\"test\",\"address\":\"fqs5shof9gvwsxs7hwaz@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/api-003.mailerlite.dev\",\"secret\":\"yAI5fwx9hR0K4gzeOxW6YBrMcoHtLtoc\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"include_attachments\":true},{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Test inbound name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"include_attachments\":true},{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example-domain.com\",\"secret\":\"FRwZFJCkf7nbydrn0oq9uLc76USD4iaI\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"include_attachments\":true}],\"links\":{\"first\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page=1\",\"last\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page=1\",\"prev\":null,\"next\":null},\"meta\":{\"current_page\":1,\"from\":1,\"last_page\":1,\"links\":[{\"url\":null,\"label\":\"« Previous\",\"active\":false},{\"url\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound?page=1\",\"label\":\"1\",\"active\":true},{\"url\":null,\"label\":\"Next »\",\"active\":false}],\"path\":\"https:\\/\\/api.mailersend.com\\/v1\\/inbound\",\"per_page\":25,\"to\":3,\"total\":3}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3b63a9a016f5f-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:52:14 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file diff --git a/src/test/resources/fixtures/InboundRoutesTest_SingleInboundRouteTest().json b/src/test/resources/fixtures/InboundRoutesTest_SingleInboundRouteTest().json index fa32b3c..58e48c7 100644 --- a/src/test/resources/fixtures/InboundRoutesTest_SingleInboundRouteTest().json +++ b/src/test/resources/fixtures/InboundRoutesTest_SingleInboundRouteTest().json @@ -1 +1 @@ -{"981d4a16b72bd8c0fba5563dabfb4f5498c48ae9":{"body":"{\"data\":{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Test inbound name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3ba6eded638c9-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:55:06 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file +{"981d4a16b72bd8c0fba5563dabfb4f5498c48ae9":{"body":"{\"data\":{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Test inbound name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"include_attachments\":true}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3ba6eded638c9-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:55:06 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file diff --git a/src/test/resources/fixtures/InboundRoutesTest_UpdateInboundRouteTest().json b/src/test/resources/fixtures/InboundRoutesTest_UpdateInboundRouteTest().json index c966635..0699ce9 100644 --- a/src/test/resources/fixtures/InboundRoutesTest_UpdateInboundRouteTest().json +++ b/src/test/resources/fixtures/InboundRoutesTest_UpdateInboundRouteTest().json @@ -1 +1 @@ -{"1aff61f4d4446105b742718ccb14f912cd075602":{"body":"{\"data\":{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Updated route name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3bf27ad6238d6-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:58:19 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file +{"1aff61f4d4446105b742718ccb14f912cd075602":{"body":"{\"data\":{\"id\":\"83yxj6ljoq4do2rm\",\"name\":\"Updated route name\",\"address\":\"vxlarh7vthhnagf3zved@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[{\"type\":\"webhook\",\"value\":\"https:\\/\\/example.com\",\"secret\":\"9IAyXyE6eAg2pre8QQfvcs3VPJSS8iaW\"}],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"include_attachments\":true}}","headers":{":status":["200"],"cache-control":["no-cache, private"],"cf-cache-status":["DYNAMIC"],"cf-ray":["73d3bf27ad6238d6-ATH"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:58:19 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"server":["cloudflare"],"strict-transport-security":["max-age=15724800; includeSubDomains"],"x-apiquota-remaining":["-1"],"x-apiquota-reset":["2022-08-20T00:00:00Z"],"x-ratelimit-limit":["60"],"x-ratelimit-remaining":["59"]},"statusCode":200}} \ No newline at end of file diff --git a/src/test/resources/fixtures/InboundRoutesTest_inbound_domain_not_required_when_domain_enabled_is_false().json b/src/test/resources/fixtures/InboundRoutesTest_inbound_domain_not_required_when_domain_enabled_is_false().json index c116a59..d3eccf8 100644 --- a/src/test/resources/fixtures/InboundRoutesTest_inbound_domain_not_required_when_domain_enabled_is_false().json +++ b/src/test/resources/fixtures/InboundRoutesTest_inbound_domain_not_required_when_domain_enabled_is_false().json @@ -1 +1 @@ -{"ad464b3b9851abf34d634bda2b845511b51fad7e":{"body":"{\"data\":{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"exclude_attachments\":false}}","headers":{":status":["201"],"cache-control":["no-cache, private"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:49:26 GMT"],"server":["cloudflare"]},"statusCode":201}} \ No newline at end of file +{"ad464b3b9851abf34d634bda2b845511b51fad7e":{"body":"{\"data\":{\"id\":\"jpr9084z9xlw63dn\",\"name\":\"Test inbound name\",\"address\":\"emcbcwyz41fdrr7uuiz1@inbound.mailersend.net\",\"domain\":null,\"dns_checked_at\":null,\"enabled\":true,\"filters\":[{\"type\":\"match_all\",\"key\":null,\"comparer\":null,\"value\":null}],\"forwards\":[],\"mxValues\":{\"priority\":\"10\",\"target\":\"inbound.mailersend.net\"},\"include_attachments\":true}}","headers":{":status":["201"],"cache-control":["no-cache, private"],"content-type":["application/json"],"date":["Fri, 19 Aug 2022 14:49:26 GMT"],"server":["cloudflare"]},"statusCode":201}} \ No newline at end of file From 0bb6af6304682fae352d5ad30d9d843a562e8f68 Mon Sep 17 00:00:00 2001 From: Odunayo Ogungbure Date: Wed, 23 Sep 2026 16:22:52 +0100 Subject: [PATCH 3/3] Describe forwarding only, not storage Co-Authored-By: Claude Opus 5 --- README.md | 2 +- .../mailersend/sdk/inboundroutes/InboundRouteBuilder.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4e6a366..c79cddc 100644 --- a/README.md +++ b/README.md @@ -908,7 +908,7 @@ public void getInboundRoute() { ### Create an inbound route -Call `includeAttachments(false)` to drop attachments before the message is stored or forwarded. It defaults to `true`. Inline (CID) parts count as attachments, so images embedded in an HTML body are dropped too. +Call `includeAttachments(false)` to drop attachments before the message is forwarded. It defaults to `true`. Inline (CID) parts count as attachments, so images embedded in an HTML body are dropped too. ```java import com.mailersend.sdk.MailerSend; diff --git a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java index 9376b10..4c3b095 100644 --- a/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java +++ b/src/main/java/com/mailersend/sdk/inboundroutes/InboundRouteBuilder.java @@ -194,9 +194,9 @@ public InboundRouteBuilder forwards(Forward[] forwards) { *

includeAttachments.

* *

Forwards attachments with the message. Defaults to {@code true}. Set it to - * {@code false} to drop them before the message is stored or forwarded; inline (CID) parts - * count as attachments, so images embedded in an HTML body are dropped too. Leaving this - * unset on an update keeps the route's stored value.

+ * {@code false} to drop them before the message is forwarded; inline (CID) parts count as + * attachments, so images embedded in an HTML body are dropped too. Leaving this unset on + * an update keeps the route's stored value.

* * @param includeAttachments a boolean. * @return a {@link com.mailersend.sdk.inboundroutes.InboundRouteBuilder} object.