Claus Ibsen created CAMEL-27895:
-----------------------------------

             Summary: camel-mail: a failed mail is skipped for good with an 
idempotentRepository, the To default depends on option order
                 Key: CAMEL-27895
                 URL: https://issues.apache.org/jira/browse/CAMEL-27895
             Project: Camel
          Issue Type: Bug
          Components: camel-mail
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-mail for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31159).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. A failed mail is skipped for good with an idempotentRepository
{{MailConsumer.retrieveMessages}} adds the idempotent key in isValidMessage 
before createExchange; when createExchange returns null (a mail flagged 
DELETED, or one that failed with skipFailedMessage or handleFailedMessage), the 
key is never removed, so every consumer sharing the repository skips the mail 
for good.
Proposed change: call removeIdempotentKey when createExchange returns null.

h4. 2. The To default depends on the order of the options
{{MailConfiguration.setUsername}} sets To to username(@host) only when no 
recipient is set yet, so ?cc=a@x&username=u sends without a To, and 
?username=u&cc=a@x sends To u@host plus Cc a@x.
Proposed change: apply the default after all options are set, when to, cc and 
bcc are empty.

h4. 3. debugMode sets javax.net.debug as a session property
createJavaMailProperties puts javax.net.debug=all into the Session properties, 
where JSSE never reads it (it is a JVM system property).
Proposed change: remove it, or document -Djavax.net.debug.


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to