Skip to content
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

Wrong email address #1521

Closed
mmallejac opened this issue Mar 26, 2024 · 4 comments
Closed

Wrong email address #1521

mmallejac opened this issue Mar 26, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@mmallejac
Copy link

Hello !

We had the following scenario quite some times now:
We want to send an email to multiple email addresses. One of these is wrong: bad domain, wrong character in the address (letter with an accent for instance), ...

When the user press Send, a "Can't send email" is shown.

Then by activating the logs, we can see the SMTP exchange with the server and find the error.
For instance:

[2024-03-26 17:14:27.166][dba2d436] SMTP[INFO]: > RCPT TO:<info@mart.ch>\r\n
[2024-03-26 17:14:27.182][dba2d436] SMTP[INFO]: < 250 2.1.5 Ok\r\n
[2024-03-26 17:14:27.182][dba2d436] SMTP[INFO]: > RCPT TO:<info@naturevaudoise.ch>\r\n
[2024-03-26 17:14:27.212][dba2d436] SMTP[INFO]: < 450 4.1.2 <info@naturevaudoise.ch>: Recipient address rejected: Domain not found\r\n
[2024-03-26 17:14:27.213][dba2d436] SMTP[ERROR]: MailSo\Smtp\Exceptions\NegativeResponseException: Failed to add recipient 'info@naturevaudoise.ch': 450 4.1.2 <info@naturevaudoise.ch>: Recipient address rejected: Domain not found in /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/MailSo/Smtp/SmtpClient.php:596
Stack trace:
#0 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/MailSo/Smtp/SmtpClient.php(504): MailSo\Smtp\SmtpClient->validateResponse(Array, 'Failed to add r...')
#1 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/MailSo/Smtp/SmtpClient.php(289): MailSo\Smtp\SmtpClient->sendRequestWithCheck('RCPT TO:<info@n...', Array, false, 'Failed to add r...')
#2 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Actions/Messages.php(821): MailSo\Smtp\SmtpClient->Rcpt('info@naturevaud...', false)
#3 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Actions/Messages.php(176): RainLoop\Actions->smtpSendMessage(Object(RainLoop\Model\AdditionalAccount), Object(MailSo\Mime\Message), Resource id #58, 18534, true, false, false)
#4 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/ServiceActions.php(134): RainLoop\Actions->DoSendMessage()
#5 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson('')
#6 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()
#7 /var/www/html/apps/snappymail/lib/Util/SnappyMailHelper.php(117): RainLoop\Service::Handle()
#8 /var/www/html/apps/snappymail/lib/Controller/PageController.php(115): OCA\SnappyMail\Util\SnappyMailHelper::startApp(true)
#9 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\SnappyMail\Controller\PageController->indexPost()
#10 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#11 /var/www/html/lib/private/AppFramework/App.php(183): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#12 /var/www/html/lib/private/Route/Router.php(315): OC\AppFramework\App::main('PageController', 'indexPost', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#13 /var/www/html/lib/base.php(1068): OC\Route\Router->match('/apps/snappymai...')
#14 /var/www/html/index.php(38): OC::handleRequest()
#15 {main}
[2024-03-26 17:14:27.213][dba2d436] SMTP[INFO]: > QUIT\r\n
[2024-03-26 17:14:27.227][dba2d436] SMTP[INFO]: < 221 2.0.0 Bye\r\n
[2024-03-26 17:14:27.227][dba2d436] SMTP[INFO]: Disconnected from "ssl://mail.infomaniak.com:465" (success)
[2024-03-26 17:14:27.228][dba2d436] SMTP[DEBUG]: 0.60878992080688 (net session)
[2024-03-26 17:14:27.228][dba2d436] SERVICE[WARNING]: CantSendMessage[302]
#0 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/ServiceActions.php(134): RainLoop\Actions->DoSendMessage()
#1 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson('')
#2 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()
#3 /var/www/html/apps/snappymail/lib/Util/SnappyMailHelper.php(117): RainLoop\Service::Handle()
#4 /var/www/html/apps/snappymail/lib/Controller/PageController.php(115): OCA\SnappyMail\Util\SnappyMailHelper::startApp(true)
#5 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\SnappyMail\Controller\PageController->indexPost()
#6 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#7 /var/www/html/lib/private/AppFramework/App.php(183): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#8 /var/www/html/lib/private/Route/Router.php(315): OC\AppFramework\App::main('PageController', 'indexPost', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#9 /var/www/html/lib/base.php(1068): OC\Route\Router->match('/apps/snappymai...')
#10 /var/www/html/index.php(38): OC::handleRequest()
#11 {main}
[2024-03-26 17:14:27.228][dba2d436] SERVICE[WARNING]: - Failed to add recipient 'info@naturevaudoise.ch': 450 4.1.2 <info@naturevaudoise.ch>: Recipient address rejected: Domain not found @ /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/MailSo/Smtp/SmtpClient.php#596
[2024-03-26 17:14:27.228][dba2d436] [ERROR]: MailSo\Smtp\Exceptions\NegativeResponseException: Failed to add recipient 'info@naturevaudoise.ch': 450 4.1.2 <info@naturevaudoise.ch>: Recipient address rejected: Domain not found in /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/MailSo/Smtp/SmtpClient.php:596
Stack trace:
#0 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/MailSo/Smtp/SmtpClient.php(504): MailSo\Smtp\SmtpClient->validateResponse(Array, 'Failed to add r...')
#1 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/MailSo/Smtp/SmtpClient.php(289): MailSo\Smtp\SmtpClient->sendRequestWithCheck('RCPT TO:<info@n...', Array, false, 'Failed to add r...')
#2 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Actions/Messages.php(821): MailSo\Smtp\SmtpClient->Rcpt('info@naturevaud...', false)
#3 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Actions/Messages.php(176): RainLoop\Actions->smtpSendMessage(Object(RainLoop\Model\AdditionalAccount), Object(MailSo\Mime\Message), Resource id #58, 18534, true, false, false)
#4 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/ServiceActions.php(134): RainLoop\Actions->DoSendMessage()
#5 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson('')
#6 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()
#7 /var/www/html/apps/snappymail/lib/Util/SnappyMailHelper.php(117): RainLoop\Service::Handle()
#8 /var/www/html/apps/snappymail/lib/Controller/PageController.php(115): OCA\SnappyMail\Util\SnappyMailHelper::startApp(true)
#9 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\SnappyMail\Controller\PageController->indexPost()
#10 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#11 /var/www/html/lib/private/AppFramework/App.php(183): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#12 /var/www/html/lib/private/Route/Router.php(315): OC\AppFramework\App::main('PageController', 'indexPost', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#13 /var/www/html/lib/base.php(1068): OC\Route\Router->match('/apps/snappymai...')
#14 /var/www/html/index.php(38): OC::handleRequest()
#15 {main}

Next RainLoop\Exceptions\ClientException: CantSendMessage[302] in /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Actions/Messages.php:304
Stack trace:
#0 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/ServiceActions.php(134): RainLoop\Actions->DoSendMessage()
#1 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson('')
#2 /var/www/html/apps/snappymail/app/snappymail/v/2.35.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()
#3 /var/www/html/apps/snappymail/lib/Util/SnappyMailHelper.php(117): RainLoop\Service::Handle()
#4 /var/www/html/apps/snappymail/lib/Controller/PageController.php(115): OCA\SnappyMail\Util\SnappyMailHelper::startApp(true)
#5 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\SnappyMail\Controller\PageController->indexPost()
#6 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#7 /var/www/html/lib/private/AppFramework/App.php(183): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#8 /var/www/html/lib/private/Route/Router.php(315): OC\AppFramework\App::main('PageController', 'indexPost', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#9 /var/www/html/lib/base.php(1068): OC\Route\Router->match('/apps/snappymai...')
#10 /var/www/html/index.php(38): OC::handleRequest()
#11 {main}
[2024-03-26 17:14:27.228][dba2d436] JSON[INFO]: {"Action":"SendMessage","Result":false,"ErrorCode":302,"ErrorMessage":"CantSendMessage[302]","ErrorMessageAdditional":"Failed to add recipient 'info@naturevaudoise.ch': 450 4.1.2 <info@naturevaudoise.ch>: Recipient address rejected: Domain not found","ExceptionCode":0,"epoch":1711473267}
[2024-03-26 17:14:27.228][dba2d436] [INFO]: Memory peak usage: 6MB
[2024-03-26 17:14:27.228][dba2d436] [INFO]: Time delta: 0.8150589466095

How the user could be helped in this situation ?

Maybe by grep'ing SMTP[ERROR] within the SMTP exchange and displaying it to the user ?

Cheers,
Michel

@the-djmaze the-djmaze added the enhancement New feature or request label Mar 26, 2024
the-djmaze pushed a commit that referenced this issue Mar 26, 2024
@the-djmaze
Copy link
Owner

The commit above should change the error in:
afbeelding

@mmallejac
Copy link
Author

Wow ! That is fast ! 👍
Yes, it would be awesome

@the-djmaze
Copy link
Owner

The solution works for you?

@the-djmaze the-djmaze added the needs feedback Further information is requested label Apr 28, 2024
@mmallejac
Copy link
Author

mmallejac commented Apr 29, 2024

It does ! Many thanks

@the-djmaze the-djmaze removed the needs feedback Further information is requested label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants