You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2021/05/14 02:04:43 UTC

[james-project] 08/09: JAMES-3574 LMTP DATA responses can specify the recipient in the comment part

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 544710b5e1958db7c757d088078b49aa80a98d32
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu May 13 12:27:46 2021 +0700

    JAMES-3574 LMTP DATA responses can specify the recipient in the comment part
    
    Mostly this helps debugging.
---
 .../james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java       | 2 +-
 .../src/test/java/org/apache/james/lmtpserver/LmtpServerTest.java     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java b/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java
index 3ee7bc4..0016c4d 100644
--- a/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java
+++ b/server/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java
@@ -98,7 +98,7 @@ public class MailboxDeliverToRecipientHandler implements DeliverToRecipientHook
             return HookResult.builder()
                 .hookReturnCode(HookReturnCode.ok())
                 .smtpReturnCode(SMTPRetCode.MAIL_OK)
-                .smtpDescription(DSNStatus.getStatus(DSNStatus.SUCCESS, DSNStatus.CONTENT_OTHER) + " Message received")
+                .smtpDescription(DSNStatus.getStatus(DSNStatus.SUCCESS, DSNStatus.CONTENT_OTHER) + " Message received <" + recipient.asString() + ">")
                 .build();
         } catch (MailboxException | UsersRepositoryException e) {
             LOGGER.error("Unexpected error handling DATA stream", e);
diff --git a/server/protocols/protocols-lmtp/src/test/java/org/apache/james/lmtpserver/LmtpServerTest.java b/server/protocols/protocols-lmtp/src/test/java/org/apache/james/lmtpserver/LmtpServerTest.java
index 41bb558..3184e5d 100644
--- a/server/protocols/protocols-lmtp/src/test/java/org/apache/james/lmtpserver/LmtpServerTest.java
+++ b/server/protocols/protocols-lmtp/src/test/java/org/apache/james/lmtpserver/LmtpServerTest.java
@@ -364,8 +364,8 @@ class LmtpServerTest {
             server.write(ByteBuffer.wrap(("QUIT\r\n").getBytes(StandardCharsets.UTF_8)));
 
             assertThat(new String(dataResponse, StandardCharsets.UTF_8))
-                .contains("250 2.6.0 Message received\r\n" +
-                    "250 2.6.0 Message received");
+                .contains("250 2.6.0 Message received <bo...@examplebis.local>\r\n" +
+                    "250 2.6.0 Message received <ce...@examplebis.local>");
         }
 
         @Test

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