Fixed Mass messaging error

andybond

Well-known member
Affected version
2.01
When doing a mass message received this error

Swift_RfcComplianceException: Address in mailbox given [SOMEONES EMAIL ADDRESS REMOVED FOR SECURITY@hotmail.co.uk] does not comply with RFC 2822, 3.6.2. in src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php at line 345
  1. Swift_Mime_Headers_MailboxHeader->_assertValidAddress() insrc/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php at line 261
  2. Swift_Mime_Headers_MailboxHeader->normalizeMailboxes() insrc/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php at line 106
  3. Swift_Mime_Headers_MailboxHeader->setNameAddresses() insrc/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php at line 63
  4. Swift_Mime_Headers_MailboxHeader->setFieldBodyModel() insrc/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php at line 58
  5. Swift_Mime_SimpleHeaderFactory->createMailboxHeader() insrc/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php at line 68
  6. Swift_Mime_SimpleHeaderSet->addMailboxHeader() insrc/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php at line 329
  7. Swift_Mime_SimpleMessage->setTo() in src/XF/Mail/Mail.php at line 47
  8. XF\Mail\Mail->setTo() in src/XF/Mail/Mail.php at line 74
  9. XF\Mail\Mail->setToUser() in src/XF/Service/Conversation/Notifier.phpat line 113
  10. XF\Service\Conversation\Notifier->_sendNotifications() insrc/XF/Service/Conversation/Notifier.php at line 58
  11. XF\Service\Conversation\Notifier->notifyCreate() insrc/XF/Service/Conversation/Creator.php at line 238
  12. XF\Service\Conversation\Creator->sendNotifications() insrc/XF/Service/Conversation/Creator.php at line 228
  13. XF\Service\Conversation\Creator->_save() insrc/XF/Service/ValidateAndSavableTrait.php at line 40
  14. XF\Service\Conversation\Creator->save() insrc/XF/Job/UserMessage.php at line 47
  15. XF\Job\UserMessage->executeAction() insrc/XF/Job/AbstractUserCriteriaJob.php at line 59
  16. XF\Job\AbstractUserCriteriaJob->run() in src/XF/Job/Manager.php at line 241
  17. XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line187
  18. XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 103
  19. XF\Job\Manager->runByIds() in src/XF/Admin/Controller/Tools.php at line 120
  20. XF\Admin\Controller\Tools->actionRunJob() insrc/XF/Mvc/Dispatcher.php at line 249
  21. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line88
  22. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line41
  23. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1880
  24. XF\App->run() in src/XF.php at line 328
  25. XF::runApp() in admin.php at line 13

I think I broke it Mister !
 
Can you confirm the email address is in a valid format?

Was this member imported from other software?
 
The error message suggest the email address is invalid but it's difficult to say without seeing the actual address.

Is it just regular characters before the @, no spaces?
 
The error message suggest the email address is invalid but it's difficult to say without seeing the actual address.

Is it just regular characters before the @, no spaces?
Correct again. Plain text nothing unusual and alpha characters !
 
I copied and pasted the email into notepad and spied a space ! That threw the error.

Now though get a further error :

  • Swift_TransportException: Email to lots of email address @from domains failed: Expected response code 250 but got code "421", with message "421 too many messages in this connection "
  • src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:383
 
The initial error should be fixed in 2.0.2. We'll now capture any errors during mail setup and log them instead of blocking. (If you're in debug mode though, we'll still throw them immediately; this would likely indicate a bug in some of your code.)

Additionally, 2.0.2 will now limit so we only send up to 99 emails in a single SMTP connection, which should hopefully prevent the "too many messages in this connection" error. (If your server has a lower limit, it won't, though that would potentially imply that it's not really designed for a large amount of mails so it may not be an ideal server to use.)
 
Back
Top Bottom