mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 01:05:11 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user