commit | 544710b5e1958db7c757d088078b49aa80a98d32 | [log] [tgz] |
---|---|---|
author | Benoit Tellier <btellier@linagora.com> | Thu May 13 12:27:46 2021 +0700 |
committer | Tellier Benoit <btellier@linagora.com> | Fri May 14 09:04:28 2021 +0700 |
tree | 14ae74a7401ad79e74a0aec4a52c6a71c75b8752 | |
parent | 3543fd3d5092fe0d6776194266d6785135d708ad [diff] |
JAMES-3574 LMTP DATA responses can specify the recipient in the comment part Mostly this helps debugging.
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 @@ 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 @@ 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 <bob@examplebis.local>\r\n" + + "250 2.6.0 Message received <cedric@examplebis.local>"); } @Test