1 最后由 rain6966 (2016-06-04 11:20:19) 编辑

主题: 使用TB 轉寄信件 "Undelivered Mail Returned to Sender"

==== ==== ==== ==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.5-1
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):OpenLDAP
- 使用的 Linux/BSD 发行版名称及版本号:CentOS6&7
- 与您的问题相关的日志信息:
====

以兩網域user 互寄 , 寄出則退信;但轉寄給 Google user 則不會被退信.

轉寄方式為: "行內轉寄" 非 "以附件轉寄" .

兩網域:                       l.domain1.com      TO      a6966.com(& domain1.com)
兩台MailServer  :        CentOS7                          CentOS6
皆為  iRedAdmin-Pro-LDAP-2.6.0 , iRedMail 0.9.5-1

(PS:實際網域改為 domain1.com , 先前已信寄提問 ,附件裡網域名稱亦改過)
log如下:

> 3). CentOS7 test@l.domain1.com 給 CentOS6 test@a6966.com寄信:
> 3-1). CentOS7:
>
2016-06-02 09:55:45 DEBUG [SQL] Query local addresses:
> SELECT id, email
>                FROM users
>               WHERE email IN ('@.', 'test@l.domain1.com', '@l.domain1.com', '@.l.domain1.com', '@domain1.com', '@.domain1.com', '@com', '@.com')
>            ORDER BY priority DESC
> 2016-06-02 09:55:45 DEBUG Local addresses (in `users`): [(1L, '@.')]
> 2016-06-02 09:55:45 DEBUG [SQL] Query external addresses:
> SELECT id, email
>                FROM mailaddr
>               WHERE email IN ('@.', 'test@a6966.com', '@a6966.com', '@.a6966.com', '@com', '@.com')
>            ORDER BY priority DESC
> 2016-06-02 09:55:45 DEBUG No record found in SQL database.
> 2016-06-02 09:55:45 DEBUG No valid sender id or recipient id.
> 2016-06-02 09:55:45 DEBUG <-- Result: DUNNO
> 2016-06-02 09:55:45 DEBUG Session ended
> 2016-06-02 09:55:45 INFO [192.168.1.66] RCPT, test@l.domain1.com => test@a6966.com, DUNNO

上面 為 test@l.domain1.com 到 test@a6966.com

SELECT id, email
               FROM users
              WHERE email IN ('@.', 'test@l.domain1.com', '@l.domain1.com', '@.l.domain1.com', '@domain1.com', '@.domain1.com', '@com', '@.com')

               FROM mailaddr
              WHERE email IN ('@.', 'test@a6966.com', '@a6966.com', '@.a6966.com', '@com', '@.com')

其檢查的 From users 及mailaddr 怎會不同 ID ? 下面也一樣 ?

>
> 3-2). CentOS6:

> 2016-06-02 09:55:50 DEBUG [SQL] Query local addresses:
> SELECT id, email
>                FROM users
>               WHERE email IN ('@.', 'test@a6966.com', '@a6966.com', '@.a6966.com', '@com', '@.com')
>            ORDER BY priority DESC
> 2016-06-02 09:55:50 DEBUG Local addresses (in `users`): [(5L, '@a6966.com'), (1L, '@.')]
> 2016-06-02 09:55:50 DEBUG [SQL] Query external addresses:
> SELECT id, email
>                FROM mailaddr
>               WHERE email IN ('@.', 'test@l.domain1.com', '@l.domain1.com', '@.l.domain1.com', '@domain1.com', '@.domain1.com', '@com', '@.com', 'test@*', '192.168.99.36', '*.*.99.36', '192.168.99.*', '192.*.*.*', '*.168.99..36', '*.*.*.36', '192.*.*.36', '192.168.*.*', '192.168.*.36', '192.*.99.36', '*.*.*.*')
>            ORDER BY priority DESC
> 2016-06-02 09:55:50 DEBUG No record found in SQL database.
> 2016-06-02 09:55:50 DEBUG No valid sender id or recipient id.
> 2016-06-02 09:55:50 DEBUG <-- Result: DUNNO
> 2016-06-02 09:55:50 DEBUG Session ended
> 2016-06-02 09:55:50 INFO [192.168.99.36] RCPT, test@l.domain1.com -> test@a6966.com, DUNNO

Post's attachments

複製 -Fwd Re Bayes filter marking everything as ham.eml 14.36 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

回复: 使用TB 轉寄信件 "Undelivered Mail Returned to Sender"

请打开 iRedAPD debug 模式,看看里面记录的 smtp session 里的 sender, recipient, sasl_username 各为什么值。
看样子似乎是 Thunderbird 在以 inline forwarding 格式转发邮件的时候弄混了邮件地址。

3 最后由 rain6966 (2016-06-04 14:29:17) 编辑

回复: 使用TB 轉寄信件 "Undelivered Mail Returned to Sender"

今早上重測試觀察log :
egrep -n20 '(2016\-06\-04 10\:1|sender|recipient|sasl_username)' /var/log/iredapd/iredapd.log

比對寄給gmail 或 兩台iRedmail user互寄或下面刪除的表頭內容 ,三者的log 皆一樣;故不是iredapd 的問題.

TB 最近的更新版本後 ,當轉寄信件時 (行內轉寄)會自動 加入信件的表頭 ,內容如下;手動刪除後則不會出現"Undelivered Mail Returned to Sender"

然何以下面表頭刪除後會OK , 倒不得其解.

感謝回覆.

PS: 寄給gmail 帳號 ;可正常收到,會一併顯示下面內容 .


-------- 轉寄郵件 --------
Return-Path: <test4@domain1.com>
Delivered-To: test@l.doamin1.com
Received: from localhost (mail.l.doamin1.com [127.0.0.1]) by mail.l.doamin1.com (Postfix) with ESMTP id A73C0B0000B5E for <test@l.doamin1.com>; Wed,  1 Jun 2016 14:35:09 +0800 (CST)
X-DSPAM-Class: Whitelisted
X-DSPAM-Confidence: 0.57
X-DSPAM-Probability: 0.0000
X-Virus-Scanned-36: By Domain1 MailServer-36
X-Spam-Flag: NO
X-Spam-Score: -5.58
X-Spam-Level: X-Spam-Status: No, score=-5.58 tagged_above=-999 required=6.36 tests=[DSPAM.Innocent=-0.109, CRM114.GOOD(19.71)=-0.907, ALL_TRUSTED=-2.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DSPAM_HAM=-1.037, RP_MATCHES_RCVD=-1.426, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-DSPAM-Result: Innocent
X-CRM114-Status: GOOD ( 19.71 )
Authentication-Results: mail.l.doamin1.com (amavisd-new); dkim=pass (2048-bit key) header.d=doamin1.com
Received: from mail.l.doamin1.com ([127.0.0.1]) by localhost (mail.l.doamin1.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xxNnBR09-Y2k for <test@l.doamin1.com>; Wed,  1 Jun 2016 14:35:08 +0800 (CST)
Received: from mail.doamin1.com (mail.doamin1.com [192.168.99.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.l.doamin1.com (Postfix) with ESMTPS id 06AEFB0000138 for <test@l.doamin1.com>; Wed,  1 Jun 2016 14:35:08 +0800 (CST)
DMARC-Filter: OpenDMARC Filter v1.3.1 mail.l.doamin1.com 06AEFB0000138
Received: from localhost (mail.doamin1.com [127.0.0.1]) by mail.doamin1.com (Domain1) with ESMTP id 3rKLFR5tt3z6sl8M for <test@l.doamin1.com>; Wed,  1 Jun 2016 14:35:07 +0800 (CST)
Authentication-Results: mail.doamin1.com (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=doamin1.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=doamin1.com; h= content-type:content-type:in-reply-to:mime-version:user-agent :date:date:message-id:from:from:to:references:subject:subject;  s=dkim; t=1464762904; x=1465626905; bh=pmJtLQioD9+U2lH5S1mdC0+q NeGt/5kvdyHohkxW0mI=; b=Ut/BbnIEqrp89H9qYJPLtdIA7r/Bye0hrp7n+/Oy GBRtJQaJPGow6s4D2yH6Ig/qC70cg1IcFGDuswKNk92XqNBcR8QgSe89hw2rKz+u s0K9XknCFxKBCek+TNtGvtEE9DE5DnyPPluWiXkJu9ltaoK6jyTlIjBDL3MGLqte Su42B8yvxVYSAhemyeI2mbkog1rmwxnBBKTNCK35VADNgGHFATyeRYZUikHYNLHw cxZXwufLzGjnJ0oJ6oASf3CFv20kba+L51dvbHL9MQuxcOeM5BD7az8WgA7d2c5t 0GFvhmOTvrVCOON2I6tYgdMLbawEcHnbeJE04HOQOUbpgQ==
X-Virus-Scanned-16: By Domain1 MailServer-16
Received: from mail.doamin1.com ([127.0.0.1]) by localhost (mail.doamin1.com [127.0.0.1]) (amavisd-new, port 10026) with LMTP id fU31COeVH4DF for <test@l.doamin1.com>; Wed,  1 Jun 2016 14:35:04 +0800 (CST)
Received: from [127.0.0.1] (localhost [127.0.0.1])  by mail.doamin1.com (X-Mail/Domain1) with ESMTPSA id 3rKLFM4nQWz6skvY  (version=TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))  for <test@l.doamin1.com>; Wed,  1 Jun 2016 14:35:03 +0800 (CST)
Subject: Fwd: Re: Bayes filter marking everything as ham
References: <BY2PR02MB131533D1B6739107C395BC21C6470@BY2PR02MB1315.namprd02.prod.outlook.com>
To: test-L-36-i <test@l.doamin1.com>
From: Test4-P <test4@doamin1.com>
X-Forwarded-Message-Id: <BY2PR02MB131533D1B6739107C395BC21C6470@BY2PR02MB1315.namprd02.prod.outlook.com>
Message-ID: <70845fc7-6e96-91fd-bfbf-cd534e0b6f5d@doamin1.com>
Disposition-Notification-To: Test4-P <test4@doamin1.com>
Date: Wed, 1 Jun 2016 14:35:04 +0800
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101 Thunderbird/45.1.0
MIME-Version: 1.0
In-Reply-To: <BY2PR02MB131533D1B6739107C395BC21C6470@BY2PR02MB1315.namprd02.prod.outlook.com>
Content-Type: multipart/mixed; boundary="------------78AA6B6538E209005073E103"

回复: 使用TB 轉寄信件 "Undelivered Mail Returned to Sender"

rain6966 写道:

TB 最近的更新版本後 ,當轉寄信件時 (行內轉寄)會自動 加入信件的表頭

收到别人寄来的邮件时,iRedAPD 的 reject_sender_login_mismatch 会检查发件人是否是伪造的(forged),例如,发件人的域名是在你的服务器上 hosting,但发件人却没有 smtp sasl auth,这时候就判断为 forged。在这个 case 里,iRedAPD 检测到了 forged sender domain,所以 reject。

此 case 里 iRedAPD 的 reject 逻辑没有错,错在于 Thunderbird forwarding 的时候加入了原始邮件的 mail headers,而很多时候做 Policy server 都是检查 mail header 里的内容(如 From:, To:, Return-path 等)。因此 Thunderbird 的 inline forwarding 会带来一定的问题。

回复: 使用TB 轉寄信件 "Undelivered Mail Returned to Sender"

問題已解決 .感謝耐心回覆  .
詳下文:
因做 隔離信件, 不希望放在SQL 且原文保留, 並可通知特定ID (管理員), 應如何設定? 的測試設定所造成