Description
Preconditions and environment
- Vanilla magento 2.4.8
- core config data: system/smtp/set_return_path -> 2 system/smtp/return_path_email -> [email protected]
Steps to reproduce
- Try to register
Expected result
User is registered, register email is sent
Actual result
User is registered, register email is not sent
Additional information
main.CRITICAL: Symfony\Component\Mime\Exception\LogicException: The "Sender" header must be an instance of "Symfony\Component\Mime\Header\MailboxHeader" (got "Symfony\Component\Mime\Header\MailboxListHeader"). in /var/www/users/magento-vanilla/src/www/vendor/symfony/mime/Header/Headers.php:244
Stack trace:
#0 /var/www/users/magento-vanilla/src/www/vendor/symfony/mime/Header/Headers.php(167): Symfony\Component\Mime\Header\Headers::checkHeaderClass()
#1 /var/www/users/magento-vanilla/src/www/vendor/symfony/mime/Header/Headers.php(84): Symfony\Component\Mime\Header\Headers->add()
#2 /var/www/users/magento-vanilla/src/www/vendor/magento/module-email/Model/Transport.php(245): Symfony\Component\Mime\Header\Headers->addMailboxListHeader()
#3 /var/www/users/magento-vanilla/src/www/vendor/magento/module-email/Model/Transport.php(222): Magento\Email\Model\Transport->setReturnPath()
#4 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Email\Model\Transport->sendMessage()
#5 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Email\Model\Transport\Interceptor->___callParent()
#6 /var/www/users/magento-vanilla/src/www/vendor/magento/module-email/Model/Mail/TransportInterfacePlugin.php(48): Magento\Email\Model\Transport\Interceptor->Magento\Framework\Interception{closure}()
#7 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Email\Model\Mail\TransportInterfacePlugin->aroundSendMessage()
#8 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Email\Model\Transport\Interceptor->Magento\Framework\Interception{closure}()
#9 /var/www/users/magento-vanilla/src/www/generated/code/Magento/Email/Model/Transport/Interceptor.php(23): Magento\Email\Model\Transport\Interceptor->___callPlugins()
#10 /var/www/users/magento-vanilla/src/www/vendor/magento/module-customer/Model/EmailNotification.php(308): Magento\Email\Model\Transport\Interceptor->sendMessage()
#11 /var/www/users/magento-vanilla/src/www/vendor/magento/module-customer/Model/EmailNotification.php(436): Magento\Customer\Model\EmailNotification->sendEmailTemplate()
#12 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Customer\Model\EmailNotification->newAccount()
#13 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Customer\Model\EmailNotification\Interceptor->___callParent()
#14 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Customer\Model\EmailNotification\Interceptor->Magento\Framework\Interception{closure}()
#15 /var/www/users/magento-vanilla/src/www/generated/code/Magento/Customer/Model/EmailNotification/Interceptor.php(23): Magento\Customer\Model\EmailNotification\Interceptor->___callPlugins()
#16 /var/www/users/magento-vanilla/src/www/vendor/magento/module-customer/Model/AccountManagement.php(999): Magento\Customer\Model\EmailNotification\Interceptor->newAccount()
#17 /var/www/users/magento-vanilla/src/www/vendor/magento/module-customer/Model/AccountManagement.php(957): Magento\Customer\Model\AccountManagement->sendEmailConfirmation()
#18 /var/www/users/magento-vanilla/src/www/vendor/magento/module-customer/Model/AccountManagement.php(869): Magento\Customer\Model\AccountManagement->createAccountWithPasswordHash()
#19 /var/www/users/magento-vanilla/src/www/generated/code/Magento/Customer/Model/AccountManagement/Interceptor.php(32): Magento\Customer\Model\AccountManagement->createAccount()
#20 /var/www/users/magento-vanilla/src/www/vendor/magento/module-customer/Controller/Account/CreatePost.php(380): Magento\Customer\Model\AccountManagement\Interceptor->createAccount()
#21 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Customer\Controller\Account\CreatePost->execute()
#22 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Customer\Controller\Account\CreatePost\Interceptor->___callParent()
#23 /var/www/users/magento-vanilla/src/www/vendor/magento/module-customer/Controller/Plugin/Account.php(64): Magento\Customer\Controller\Account\CreatePost\Interceptor->Magento\Framework\Interception{closure}()
#24 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Customer\Controller\Plugin\Account->aroundExecute()
#25 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Customer\Controller\Account\CreatePost\Interceptor->Magento\Framework\Interception{closure}()
#26 /var/www/users/magento-vanilla/src/www/generated/code/Magento/Customer/Controller/Account/CreatePost/Interceptor.php(23): Magento\Customer\Controller\Account\CreatePost\Interceptor->___callPlugins()
#27 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/App/Action/Action.php(111): Magento\Customer\Controller\Account\CreatePost\Interceptor->execute()
#28 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch()
#29 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Customer\Controller\Account\CreatePost\Interceptor->___callParent()
#30 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Customer\Controller\Account\CreatePost\Interceptor->Magento\Framework\Interception{closure}()
#31 /var/www/users/magento-vanilla/src/www/generated/code/Magento/Customer/Controller/Account/CreatePost/Interceptor.php(32): Magento\Customer\Controller\Account\CreatePost\Interceptor->___callPlugins()
#32 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/App/FrontController.php(245): Magento\Customer\Controller\Account\CreatePost\Interceptor->dispatch()
#33 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#34 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/App/FrontController.php(146): Magento\Framework\App\FrontController->processRequest()
#35 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#36 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#37 /var/www/users/magento-vanilla/src/www/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(99): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#38 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch()
#39 /var/www/users/magento-vanilla/src/www/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(72): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#40 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch()
#41 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#42 /var/www/users/magento-vanilla/src/www/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#43 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#44 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Http->launch()
#45 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\Http\Interceptor->___callParent()
#46 /var/www/users/magento-vanilla/src/www/vendor/magento/module-application-performance-monitor/Plugin/ApplicationPerformanceMonitor.php(38): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception{closure}()
#47 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(135): Magento\ApplicationPerformanceMonitor\Plugin\ApplicationPerformanceMonitor->aroundLaunch()
#48 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception{closure}()
#49 /var/www/users/magento-vanilla/src/www/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http\Interceptor->___callPlugins()
#50 /var/www/users/magento-vanilla/src/www/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#51 /var/www/users/magento-vanilla/src/www/pub/index.php(29): Magento\Framework\App\Bootstrap->run()
#52 {main}
private function setReturnPath(SymfonyMessage $email): void
{
if ($this->isSetReturnPath === 2 && $this->returnPathValue) {
$email->getHeaders()->addMailboxListHeader('Sender', [$this->returnPathValue]);
} elseif ($this->isSetReturnPath === 1 &&
!empty($fromAddresses = $email->getHeaders()->get('From')?->getAddresses())) {
reset($fromAddresses);
$email->getHeaders()->addMailboxListHeader('Sender', [current($fromAddresses)->getAddress()]);
}
}
is fixable when changing
$email->getHeaders()->addMailboxListHeader('Sender', [$this->returnPathValue]);
to
$email->getHeaders()->addMailboxHeader('Sender', $this->returnPathValue);
and
$email->getHeaders()->addMailboxListHeader('Sender', [current($fromAddresses)->getAddress()]);
to
$email->getHeaders()->addMailboxHeader('Sender', current($fromAddresses)->getAddress());
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status