chore: consider X-original-sender to create contact in case of group mail (#2841)

For emails forwarded from google groups, Google rewrites the FROM address to the group email and the original email will be available under X-Original-Sender. This PR enables chatwoot to handle this case.

Fixes: #2715
This commit is contained in:
Tejaswini Chile
2021-08-24 14:18:08 +05:30
committed by GitHub
parent 6515b69560
commit 09e3413d10
4 changed files with 654 additions and 2 deletions

View File

@@ -82,6 +82,10 @@ class MailPresenter < SimpleDelegator
@mail.from.map(&:downcase)
end
def original_sender
@mail['X-Original-Sender'].try(:value) || from.first
end
private
# forcing the encoding of the content to UTF-8 so as to be compatible with database and serializers