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 2024/02/28 17:32:32 UTC

(james-project) 01/03: [FIX] Avoid forwarding bounces

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 cf16dbea09d676030be7451bc49f98aa7b1eb8a8
Author: Benoit TELLIER <bt...@linagora.com>
AuthorDate: Wed Feb 14 15:50:44 2024 +0100

    [FIX] Avoid forwarding bounces
---
 .../james/transport/mailets/RecipientRewriteTableProcessor.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
index 01e6109312..3220bf55a6 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
@@ -278,7 +278,12 @@ public class RecipientRewriteTableProcessor {
         void apply(Mail mail) throws Exception;
     }
 
-    public void processForwards(Mail mail) {
+    public void processForwards(Mail mail) throws MessagingException {
+        if (Optional.ofNullable(mail.getMessage().getHeader("Auto-Submitted")).map(ImmutableList::copyOf).orElse(ImmutableList.of())
+            .stream()
+            .anyMatch(value -> value.startsWith("auto-replied"))) {
+            return;
+        }
         if (rewriteSenderUponForward) {
             mail.getRecipients()
                 .stream()


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