oscerd opened a new pull request, #25568: URL: https://github.com/apache/camel/pull/25568
Fixes [CAMEL-24419](https://issues.apache.org/jira/browse/CAMEL-24419). ## Problem CAMEL-23522 extended `MailHeaderFilterStrategy` so the **inbound** path also filters the `mail.smtp.` and `mail.smtps.` prefixes, not just `Camel*`/`camel*`: ```java String[] inFilter = Arrays.copyOf(CAMEL_FILTER_STARTS_WITH, CAMEL_FILTER_STARTS_WITH.length + 2); inFilter[CAMEL_FILTER_STARTS_WITH.length] = "mail.smtp."; inFilter[CAMEL_FILTER_STARTS_WITH.length + 1] = "mail.smtps."; setInFilterStartsWith(inFilter); ``` `MimeMultipartDataFormat` — which CAMEL-23891 gave a header filter for the `Camel*` namespace — still held a plain `DefaultHeaderFilterStrategy`, which only knows `Camel*`/`camel*`. So the namespace CAMEL-23522 deliberately filters on the consumer path was **not** filtered by the `headersInline` unmarshal path. Two entry points into the same component disagreed about the filtered namespace. ## Change One-line swap to `MailHeaderFilterStrategy`. I checked two things first to keep the blast radius honest: 1. `MailHeaderFilterStrategy.initialize()` only calls `setInFilterStartsWith(...)` — it never touches the out filter, which keeps `DefaultHeaderFilterStrategy`'s field default. **Marshal behaviour is unchanged.** 2. The strategy is referenced at exactly **one** site in the data format: `copyNonStandardHeaders()` → `applyFilterToExternalHeaders()`, which is the inbound direction. So the change does precisely one thing: unmarshal now filters the same namespace as the consumer. ## Testing New test sits next to the existing CAMEL-23891 `unmarshalInlineHeadersFiltersCamelInternalHeaders`. Verified it catches the regression: it **fails against the pre-fix code** and passes after. ``` mvn test -Dtest='MimeMultipartDataFormatTest#unmarshalInlineHeadersFiltersMailSessionPropertyHeaders' mvn clean install -DskipTests # full reactor, BUILD SUCCESS ``` ## Backport Intended for **camel-4.22.x, camel-4.18.x and camel-4.14.x**, matching the CAMEL-23891 backports. The upgrade-guide entry stays on `main` per the project's guide policy. --- _Claude Code on behalf of -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
