FIX: Handle forwarded email quotes around Reply-To display name (#14384)

The display name can have quotes around it, which does not work
with our current comparison of a from field (in this case Reply-To)
and another header (X-Original-From), because we are not comparing
the two values in the same way. This causes an issue where the
commit here: b88d8c8 will not
work properly; the forwarded email gets the From address instead
of the Reply-To address as intended.
This commit is contained in:
Martin Brennan
2021-09-20 16:26:18 +10:00
committed by GitHub
parent 36bd6e8c3b
commit 4fb7d045a0
3 changed files with 34 additions and 5 deletions

View File

@ -637,7 +637,10 @@ module Email
comparison_failed = false
comparison_headers.each do |comparison_header|
comparison_failed = true if address_field.to_s != mail_object[comparison_header].to_s
if mail_object[comparison_header].to_s != "#{from_display_name} <#{from_address}>"
comparison_failed = true
break
end
end
next if comparison_failed