Skip to content

Symfony\Component\Mime\Exception\LogicException: The "Sender" header must be an instance of "Symfony\Component\Mime\Header\MailboxHeader" (got "Symfony\Component\Mime\Header\MailboxListHeader") #39823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 5 tasks
reficulddd opened this issue Apr 17, 2025 · 14 comments
Assignees
Labels
Area: Admin UI Component: Email Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Progress: PR Created Indicates that Pull Request has been created to fix issue Reported on 2.4.8 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@reficulddd
Copy link

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

  1. 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”.
Copy link

m2-assistant bot commented Apr 17, 2025

Hi @reficulddd. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

Copy link

m2-assistant bot commented Apr 17, 2025

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.8 Indicates original Magento version for the Issue report. label Apr 17, 2025
@engcom-Bravo
Copy link
Contributor

Hi @reficulddd,

Thanks for your reporting and collaboration.

We have tried to reproduce the issue in latest 2.4-develop instance and 2.4.8 instance and we are not able to reproduce the issue.After user is registered register email was sent successfully.

Image

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Apr 17, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Apr 17, 2025
@reficulddd
Copy link
Author

Hi @engcom-Bravo, did you set:


<return_path_email>[email protected]</return_path_email>
<set_return_path>2</set_return_path>


?

It sends mail for me as well when set_return_path is 0 but doesn't send it if it's 1 or 2
I'm also testing on vanilla magento and I have an issue there

@engcom-Delta
Copy link
Contributor

Hi @reficulddd ,

Thanks for your reporting and collaboration.
We have tried to reproduce the issue in Latest 2.4-develop instance and we are able to reproduce the issue.Kindly refer the screenshots.

Steps to reproduce :

  1. core config data: system/smtp/set_return_path -> 2 system/smtp/return_path_email -> [email protected]

Image

  1. Try to register.
  2. Observe no registeration email is sent, observe the exception log.

Image

Hence Confirming the issue.

Thanks.

@engcom-Delta engcom-Delta added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Component: Email Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Admin UI and removed Issue: needs update Additional information is require, waiting for response labels Apr 24, 2025
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-14520 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented Apr 24, 2025

✅ Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-Bravo engcom-Bravo removed their assignment Apr 25, 2025
@engcom-Hotel engcom-Hotel added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Apr 29, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this to Ready for Development in High Priority Backlog Apr 29, 2025
@TomashKhamlai
Copy link
Contributor

@magento I am working on this

Copy link

m2-assistant bot commented May 1, 2025

Hi @TomashKhamlai! 👋
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

@TomashKhamlai
Copy link
Contributor

@magento add to contributors team

Copy link

m2-assistant bot commented May 1, 2025

Hi @TomashKhamlai! 👋
Thank you for joining. Please accept team invitation 👉 here 👈 and add your comment one more time.

@TomashKhamlai
Copy link
Contributor

@magento I am working on this

@engcom-Bravo
Copy link
Contributor

Hi @reficulddd,

Adobe Commerce Engineering team started working on this issue. We will reach out to you if we need more information and you will get notified once the issue is fixed. Please leave comments for any further questions.

Thank you!

@github-jira-sync-bot github-jira-sync-bot added the Progress: PR Created Indicates that Pull Request has been created to fix issue label May 6, 2025
@engcom-Bravo
Copy link
Contributor

Hello,

As I can see this issue got fixed in the scope of the internal Jira ticket AC-14520 by the internal team
Related commits:https://github.com/search?q=repo%3Amagento%2Fmagento2+AC-14520&type=commits

1e14bd7

Based on the Jira ticket, the target version is 2.4.9-alpha1.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Admin UI Component: Email Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Progress: PR Created Indicates that Pull Request has been created to fix issue Reported on 2.4.8 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Status: Ready for Development
Development

Successfully merging a pull request may close this issue.

6 participants