mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -06:00
e9dc88a7b6
When replying to a user_private_message email originating from a group PM that does _not_ have a reply key (e.g. when replying directly to the group's SMTP address), we were mistakenly linking the new post created from the reply to the OP and the user who created the topic, based on the first IncomingEmail message ID in the topic, rather than using the correct reply to user and post number that the user actually replied to. We now use the In-Reply-To header to look up the corresponding EmailLog record when the user who replied was sent a user_private_message email, and use the post from that as the reply_to_user/post. This also removes superfluous filtering of incoming_email records. After already filtering by message_id and then addressed_to_user (which only returns incoming emails where the to, from, or cc address includes any of the user's emails), we were filtering again but in the ruby code for the exact same conditions. After removing this all existing tests still pass.
15 lines
447 B
Plaintext
15 lines
447 B
Plaintext
Return-Path: <two@foo.com>
|
|
From: Two <two@foo.com>
|
|
To: team@somesmtpaddress.com
|
|
Subject: Full email group username flow
|
|
Date: Saturday, 16 Jan 2016 00:12:43 +0100
|
|
Message-ID: <348ct38794nyt9338dsfsd@foo.bar.mail>
|
|
In-Reply-To: <MESSAGE_ID_REPLY_TO>
|
|
References: <u4w8c9r4y984yh98r3h69873@foo.bar.mail>
|
|
<MESSAGE_ID_REPLY_TO>
|
|
Mime-Version: 1.0
|
|
Content-Type: text/plain
|
|
Content-Transfer-Encoding: 7bit
|
|
|
|
Hey thanks for the suggestion, it didn't work.
|