Switch order of Service Desk 'from' address
Zendesk: https://gitlab.zendesk.com/agent/tickets/81523
A customer on GitLab.com is noticing that Service Desk emails are not getting to the user that submitted the ticket. They said it appears to be because GitLab grabs the 'Sender' header rather than 'From'. In the code I see that we have a specific trial order to determine the from address:
I think the order should change so mail.sender
is last. As the customer says, "Middle servers / relays / sending servers are free to replace the content in the "Sender" field as supposed."
Change to:
def from_address
(mail.reply_to || []).first || mail.from.first || mail.sender
end