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 bt...@apache.org on 2020/06/19 04:12:13 UTC

[james-project] 09/12: JAMES-3210 make the dsn text message nicer by separating the recipients

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 f38dac2f7a64e7b66926980c1641c70d2d32cb25
Author: RĂ©mi KOWALSKI <rk...@linagora.com>
AuthorDate: Tue Jun 16 16:20:32 2020 +0200

    JAMES-3210 make the dsn text message nicer by separating the recipients
---
 .../main/java/org/apache/james/transport/mailets/DSNBounce.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/DSNBounce.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/DSNBounce.java
index 6354d32..11b4a06 100755
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/DSNBounce.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/DSNBounce.java
@@ -30,6 +30,7 @@ import java.util.List;
 import java.util.Optional;
 import java.util.Set;
 import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 
 import javax.inject.Inject;
 import javax.mail.MessagingException;
@@ -356,9 +357,10 @@ public class DSNBounce extends GenericMailet implements RedirectNotify {
 
         builder.append(bounceMessage()).append(LINE_BREAK);
         builder.append("Failed recipient(s):").append(LINE_BREAK);
-        for (MailAddress mailAddress : originalMail.getRecipients()) {
-            builder.append(mailAddress);
-        }
+        builder.append(originalMail.getRecipients()
+                .stream()
+                .map(MailAddress::asString)
+                .collect(Collectors.joining(", ")));
         builder.append(LINE_BREAK).append(LINE_BREAK);
         builder.append("Error message:").append(LINE_BREAK);
         builder.append(AttributeUtils.getValueAndCastFromMail(originalMail, DELIVERY_ERROR, String.class).orElse("")).append(LINE_BREAK);


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