更改/删除 Apache James 中的“Return-Path”标头

更改/删除 Apache James 中的“Return-Path”标头

Apache James 处理完邮件后,似乎设置了“Return-Path”标头。我想更改其值(如果不可能的话),或者完全阻止生成它。我尝试使用RemoveMimeHeader 邮件在 mailetcontainer.xml 中,但这似乎不起作用。配置如下所示:

<mailet match="All" class="RemoveMimeHeader">
<name>Return-Path</name>
</mailet>

我在处理器状态为出站的 RemoteDelivery 邮件之前和之后添加了此邮件,但两者似乎都不起作用。在上下文中,整个出站处理器如下所示:

            <processor state="outbound" enableJmx="true">

                          <mailet match="All" class="RemoveMimeHeader">
                            <name>Return-Path</name>
                    </mailet>


                    <mailet match="All" class="RemoteDelivery">
                            <outgoingQueue>outgoing</outgoingQueue>

                            <!-- Delivery Schedule based upon RFC 2821, 4.5.4.1 -->
                            <!-- 5 day retry period, with 4 attempts in the first hour, two more within the first 6 hours, and then every 6 hours for the rest of the period. -->
                            <delayTime>5 minutes</delayTime>
                            <delayTime>10 minutes</delayTime>
                            <delayTime>45 minutes</delayTime>
                            <delayTime>2 hours</delayTime>
                            <delayTime>3 hours</delayTime>
                            <delayTime>6 hours</delayTime>
                            <maxRetries>25</maxRetries>

                            <!-- The max reties which will used if no A or MX record for the domain was found. -->
                            <!-- If 0 it will fail on first time -->
                            <maxDnsProblemRetries>0</maxDnsProblemRetries>

                            <!-- The number of threads that should be trying to deliver outgoing messages -->
                            <deliveryThreads>10</deliveryThreads>

                            <!-- If false the message will not be sent to given server if any recipients fail -->
                            <sendpartial>true</sendpartial>

                            <!-- By default we send bounces to the "bounce" processor -->
                            <!-- By removing this configuration James will fallback to hardcoded bounce -->
                            <!-- notifications -->
                            <bounceProcessor>bounces</bounceProcessor>

                            <!--
                            CHANGE ME: Replace smtp relay hostname  -->
                            <heloName>[host]</heloName>

                    </mailet>


        </processor>

关于如何改变该值(目前是静态的)或删除它,有什么帮助吗?

答案1

我在自定义 Mailet 中修复了这个问题。只需注意,“返回路径”不是普通的标头:James 使用信封发件人的值自动为外发邮件设置该路径 - 此值只能为 SMTP 消息设置。

相关内容