Andrea Cosentino created CAMEL-23520:
----------------------------------------

             Summary: camel-mail: option to lock recipients/sender/subject to 
endpoint URI
                 Key: CAMEL-23520
                 URL: https://issues.apache.org/jira/browse/CAMEL-23520
             Project: Camel
          Issue Type: Improvement
          Components: camel-mail
            Reporter: Andrea Cosentino


MailBinding.populateMailMessage dispatches to setRecipientFromCamelMessage 
whenever an inbound exchange has a To/CC/BCC header, overriding the endpoint 
URI recipients. appendHeadersFromCamelMessage does the same for 
from/sender/subject. This is intentional and documented in mail-component.adoc 
("Headers take precedence over pre-configured recipients"); see also CAMEL-812.

Proposal: add opt-in @UriParam options on MailConfiguration (defaults preserve 
current behaviour, no breaking change):

* useHeaderRecipients (default true) - when false, populateMailMessage always 
uses setRecipientFromEndpointConfiguration.
* useHeaderFrom / useHeaderSubject (default true) - when false, 
appendHeadersFromCamelMessage skips the from/sender and subject overrides.

Also add a doc note cross-linking to 
docs/user-manual/modules/ROOT/pages/security-model.adoc, section "Strip headers 
at the trust boundary".

Tests covering both true and false for each new option.

_Claude Code on behalf of Andrea Cosentino_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to