Incoming email with reply-to header not honored

Hi,

When a user reply in discourse to a message coming from an email with a reply-to header, it seems that the outgoing email is sent to the from email address and not the one in reply-to header.

Is it expected to work like this ?

Note: We have a Wordpress web site using a contact form. We would like to receive the message into discourse and be able to reply directly within discourse.

I think that is expected. Have you added a form to your website that users can add their email address to? If I’m understanding what you are trying to do, it would be risky to assume that users are entering the correct email address into the form.

2 Likes

The contact form seems to work has expected.

Here is an example

  1. The form content :

  2. The message received by email :

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)

Here is the result

Note: pay attention to those fields :

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

In discourse, responding to the message will send an email to admin@xxx_my_domain.net and not evantill@yahoo.fr

But if I change my form to send the email to my gmail account and I reply to the email, the response will be send to evantill@yahoo.fr has expected.

If Discourse used the reply-to address that would effectively enable impersonation for any category or group inbox which had a public email address.

It’s probably right that this doesn’t work the way you’re hoping by default.

I realize that it would be less straightforward from the user’s point of view, but you could use a mailto link on your website to open the user’s default mail program. That way the email would be sent from the user’s email address.

If users are able to login to your website and you have some way of associating your website’s users with Discourse users (for example, checking that the emails match), you could add a form to your website that would allow logged in users to post to Discourse via the Discourse API.

1 Like