FIX: Use original from address when forwarding to group inbox (PR #14114)

When emails were forwarded to a group inbox by the email address of the group, for example when an email ends up in spam and must be manually forwarded to the group+site@discoursemail.com address, the OP of the topic ended up being the group’s email address instead of the sender who originally sent the email to the group inbox.

This commit detects that an email has been forwarded using existing tools, and if the from address matches one of the group incoming email addresses, then we look at the forwarded email’s from address and use that instead for the incoming email from address as well as the staged/regular user used for the Topic.user.

This will make it much cleaner to forward emails into a group inbox, and will prevent issues with PostAlerter where the OP is double-notified for these emails.

GitHub