You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Benoit Tellier (Jira)" <se...@james.apache.org> on 2022/07/13 10:35:00 UTC

[jira] [Comment Edited] (JAMES-3791) Remote Delivery sometimes uses wrong MAIL FROM address

    [ https://issues.apache.org/jira/browse/JAMES-3791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17566241#comment-17566241 ] 

Benoit Tellier edited comment on JAMES-3791 at 7/13/22 10:34 AM:
-----------------------------------------------------------------

+1 thanks for taking care of the fix.

If it helps, I can also ask my team to write an integration test reproducing the issue. This could complement your work.


was (Author: btellier):
+1 thanks for taking care of the fix.

I asked also my team to write an integration test reproducing the issue. This will complement your work.

> Remote Delivery sometimes uses wrong MAIL FROM address
> ------------------------------------------------------
>
>                 Key: JAMES-3791
>                 URL: https://issues.apache.org/jira/browse/JAMES-3791
>             Project: James Server
>          Issue Type: Bug
>          Components: Remote Delivery
>    Affects Versions: master, 3.7.0
>            Reporter: Karsten Otto
>            Priority: Major
>
> *Observed Issue:*
> When delivering a mail to a remote server, James sometimes under load uses the wrong envelope sender (MAIL FROM). This creates a wrong Return-Path at the recipients end, which among other things causes problems with DSN replies.
> *Analysis:*
> I traced this to MailDelivrerToHost.tryDeliveryToHost(), which shows in the debug log a pattern like:
>  # Attempting delivery of ... from ALICE@example.org
>  # Mail sent successfully to ... from BOB@example.org
> I also notice that getPropertiesForMail() modifies the shared SMTPSession by putting the envelope sender into its properties. So this is likely a race condition.
> *Possible Fixes:*
> I am not sure what the best fix for this would be:
>  # Make tryDeliveryToHost() synchronized (ugly)
>  # Use SMTPMessage.setEnvelopeSender() instead of SMTPSession properties
> Fix 2 is nicer as it preserves concurrency, but it requires that mail.getMessage() is always an SMTPMessage (extends MimeMessage). I do not know the James code base well enough to be certain of that.
> Any thoughts?



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

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org