收到的电子邮件未遵循回复-收件人标头

你好,

当用户在 Discourse 中回复来自带有 reply-to 头部的电子邮件的消息时,发出的邮件似乎被发送到了 from 地址,而不是 reply-to 头部中指定的地址。

这是预期的行为吗?

注意:我们有一个使用联系表单的 WordPress 网站。我们希望将收到的消息导入到 Discourse 中,并能够直接在 Discourse 内进行回复。

我认为这是预期的行为。你是否在你的网站上添加了一个表单,让用户可以输入他们的电子邮件地址?如果我的理解正确,你试图实现的功能存在风险,因为不能假设用户在表单中输入的电子邮件地址是正确的。

联系表单似乎按预期工作。

示例如下

  1. 表单内容:

  2. 通过电子邮件收到的消息:

Received: from 3.XXX_HOST_1 (Unknown [127.0.0.1])
	by 7beca71408ba (Haraka/2.8.25) with ESMTP id EA5F3683-54AD-422E-97D5-9CB6A8AEB16E.1
	envelope-from <bounce-id=D246=U868681.cluster011.ovh.net=1599025585.8-K6EGK@mail-out.ZZZ_HOST_3>;
	Wed, 02 Sep 2020 05:46:26 +0000
Received: from YYY_HOST_2 (unknown [10.110.208.156])
	by XXX_HOST_1 (Postfix) with ESMTP id 08F161D735F
	for <wexisam296@hapremx.com>; Wed,  2 Sep 2020 07:46:25 +0200 (CEST)
Received: from YYY_HOST_2 (localhost.localdomain [127.0.0.1])
	by YYY_HOST_2 (Postfix) with ESMTP id DE3374E006D
	for <wexisam296@hapremx.com>; Wed,  2 Sep 2020 07:46:25 +0200 (CEST)
Received: from ZZZ_HOST_3 (gwc.ZZZ_HOST_3
 [51.68.11.215])
 by YYY_HOST_2 (Postfix) with ESMTP id
 37B564E006D
 for <wexisam296@hapremx.com>; Wed,  2 Sep 2020 07:46:25 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
 by localhost.domain.tld (Postfix) with ESMTP id 2BB755FAD6
 for <wexisam296@hapremx.com>; Wed,  2 Sep 2020 07:46:25 +0200 (CEST)
Received: by ZZZ_HOST_3 (Postfix, from userid 868681)
 id 01D9A5FADA; Wed,  2 Sep 2020 07:46:24 +0200 (CEST)
To: wexisam296@hapremx.com
Subject: =?UTF-8?Q?Message_envoy=C3=A9_depuis_le_site_Apel_Sophie_Bar?=
 =?UTF-8?Q?at_=C3=A0_destination_de_essai=5Ftemp?=
Date: Wed, 2 Sep 2020 05:46:24 +0000
From: User using the contact form <admin@xxx_my_domain.net>
Reply-To: evantill@yahoo.fr
Message-ID: <E4sXx1ZVE6Nts2dxPLiQOJic5uKDp897iXgVvX2PHk@www.xxx_my_domain.net>
X-Mailer: PHPMailer 6.1.6 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Ovh-Tracer-Id: 3580643179988386017
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: xxx

De : User using the contact form <evantill@yahoo.fr>
Destinataire : essai_temp <wexisam296@hapremx.com>

Corps du message :
This is my message

-- 
Cet e-mail a été envoyé via le formulaire de contact de MY_SITE (https://www.xxx_my_domain.net)

结果如下

注意:请特别关注以下字段:

From: User using the contact form <admin@xxx_my_domain.net>
Reply-To: evantill@yahoo.fr

在 Discourse 中,回复该消息会将邮件发送至 admin@xxx_my_domain.net,而不是 evantill@yahoo.fr

但是,如果我修改表单,将邮件发送至我的 Gmail 账户,然后回复该邮件,回复将会按预期发送至 evantill@yahoo.fr

如果 Discourse 使用回复地址,这将实际上允许对任何拥有公开电子邮件地址的类别或群组收件箱进行身份冒充。

默认情况下此功能无法按您期望的方式工作,这大概是正确的。

我意识到从用户的角度来看,这样做可能不够直接,但您可以在网站上使用 mailto 链接来打开用户的默认邮件程序。这样,邮件就会从用户的邮箱地址发送。

如果用户能够登录您的网站,并且您有某种方式将您网站的用户与 Discourse 用户关联起来(例如,通过检查邮箱是否匹配),您可以在网站上添加一个表单,允许已登录用户通过 Discourse API 发布内容到 Discourse。