Problem
In EmailWebformHandler::sendMessage() there is a 'from' address which is being constructed from the name and the mail. Currently it has the the "mail_address " format, but is this format valid? Shouldn't it be "Mail Name "? When using the current format I had quite some issues with the 'From' header containing some other things (in this case was the domain name of the testing server). By changing to "Mail Name " the issues were solved.
Proposed solution
This should be pretty straight forward, something like:
$from = $message['from_mail'];
if (!empty($message['from_name'])) {
$from = $message['from_name'] . ' <' . $from . '>';
}
But again, not sure if the current format is really not valid.
Comments
Comment #2
jrockowitz commentedI think you are right and core is using
User <user@example.com>.@see \Drupal\Core\Mail\MailManager::doMail
Would be able to upload a patch and change this ticket's status to 'Needs review', which will trigger the automated tests.
Comment #3
vasi1186 commentedAttached a patch that should fix the issue.
Comment #5
jrockowitz commented