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 <btell...@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-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org

Reply via email to