mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FEATURE: Use Message-ID for detecting email replies to group
Ignores the site setting "find_related_post_with_key" and always tries to honor the `In-Reply-To` and `References` header for emails sent to a group. The senders email address must be included in the `To` or `CC` header of a previous email sent to the group and the `Message-ID` of that email must be included in the current email's `In-Reply-To` or `References` header.
This commit is contained in:
parent
e36e9de28a
commit
f2d00e5eff
4 changed files with 98 additions and 32 deletions
|
@ -197,11 +197,7 @@ module ImportScripts::Mbox
|
|||
end
|
||||
|
||||
def extract_reply_message_ids(mail)
|
||||
message_ids = [mail.in_reply_to, Email::Receiver.extract_references(mail.references)]
|
||||
message_ids.flatten!
|
||||
message_ids.select!(&:present?)
|
||||
message_ids.uniq!
|
||||
message_ids.first(20)
|
||||
Email::Receiver.extract_reply_message_ids(mail, max_message_id_count: 20)
|
||||
end
|
||||
|
||||
def extract_subject(receiver, list_name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue