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

Error 2.7.0 Authentication successful #637

Open
MarcTroll opened this issue Dec 14, 2024 · 0 comments
Open

Error 2.7.0 Authentication successful #637

MarcTroll opened this issue Dec 14, 2024 · 0 comments

Comments

@MarcTroll
Copy link

Hi,

we are switching our Mail Server from a self hosted Mailcow (SMTP) to Microsoft Graph since this is our main mail server for a year now. To allow softwares to send emails via SMTP (that do not allow sending mails through Microsoft Graph directly) I setup an SMTP to Microsoft Graph relay service. This service runs locally without any authentication or similar.

After setting the service up, I reconfigured our stack to use the local mail server. While the most of our software being used work perfectly with the relay, ep3-bs does not. I receive the following exception when trying to send an email (tested with the "forgot password" functionality):

Type
Zend\Mail\Protocol\Exception\RuntimeException
Mitteilung
2.7.0 Authentication successful
File
/opt/public/bw-bs/vendor/zendframework/zend-mail/src/Protocol/AbstractProtocol.php:348
Stack trace
#0 /opt/public/bw-bs/vendor/zendframework/zend-mail/src/Protocol/Smtp/Auth/Plain.php(74): Zend\Mail\Protocol\AbstractProtocol->_expect()
#1 /opt/public/bw-bs/vendor/zendframework/zend-mail/src/Protocol/Smtp.php(222): Zend\Mail\Protocol\Smtp\Auth\Plain->auth()
#2 /opt/public/bw-bs/vendor/zendframework/zend-mail/src/Transport/Smtp.php(401): Zend\Mail\Protocol\Smtp->helo()
#3 /opt/public/bw-bs/vendor/zendframework/zend-mail/src/Transport/Smtp.php(383): Zend\Mail\Transport\Smtp->connect()
#4 /opt/public/bw-bs/vendor/zendframework/zend-mail/src/Transport/Smtp.php(394): Zend\Mail\Transport\Smtp->lazyLoadConnection()
#5 /opt/public/bw-bs/vendor/zendframework/zend-mail/src/Transport/Smtp.php(251): Zend\Mail\Transport\Smtp->connect()
#6 /opt/public/bw-bs/module/Base/src/Base/Service/MailService.php(53): Zend\Mail\Transport\Smtp->send()
#7 /opt/public/bw-bs/module/Base/src/Base/Service/MailService.php(77): Base\Service\MailService->send()
#8 /opt/public/bw-bs/module/Base/src/Base/Service/MailService.php(89): Base\Service\MailService->sendWithAttachments()
#9 /opt/public/bw-bs/module/User/src/User/Service/MailService.php(39): Base\Service\MailService->sendPlain()
#10 /opt/public/bw-bs/module/User/src/User/Controller/AccountController.php(62): User\Service\MailService->send()
#11 /opt/public/bw-bs/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(84): User\Controller\AccountController->passwordAction()
#12 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch()
#13 /opt/public/bw-bs/vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func()
#14 /opt/public/bw-bs/vendor/zendframework/zend-eventmanager/src/EventManager.php(260): Zend\EventManager\EventManager->triggerListeners()
#15 /opt/public/bw-bs/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(116): Zend\EventManager\EventManager->triggerEventUntil()
#16 /opt/public/bw-bs/vendor/zendframework/zend-mvc/src/DispatchListener.php(118): Zend\Mvc\Controller\AbstractController->dispatch()
#17 [internal function]: Zend\Mvc\DispatchListener->onDispatch()
#18 /opt/public/bw-bs/vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func()
#19 /opt/public/bw-bs/vendor/zendframework/zend-eventmanager/src/EventManager.php(260): Zend\EventManager\EventManager->triggerListeners()
#20 /opt/public/bw-bs/vendor/zendframework/zend-mvc/src/Application.php(340): Zend\EventManager\EventManager->triggerEventUntil()
#21 /opt/public/bw-bs/public/index.php(66): Zend\Mvc\Application->run()
#22 {main}

The mail configuration is the following:

    'mail' => array(
        'type' => 'smtp', // or 'smtp' or 'smtp-tls'
        'address' => '[email protected]',

        'host' => 'localhost', // for 'smtp' type only, otherwise remove or leave as is
        'user' => '', // for 'smtp' type only, otherwise remove or leave as is
        'pw' => '', // for 'smtp' type only, otherwise remove or leave as is

        'port' => '25', // for 'smtp' type only, otherwise remove or leave as is
        'auth' => 'plain', // for 'smtp' type only, change this to 'login' if you have problems with SMTP authentication
    ),

As the relay service (https://github.com/ggpwnkthx/Microsoft-Graph-SMTP-Relay/tree/main) does not require authentication, I left user and password empty, which seems to failure in ep3-bs. Due to the exception and the relay log (attached below) I think ep3-bs can not handle cases, where no authentication is provided but expects authentication.

INFO:mail.log:Available AUTH mechanisms: LOGIN PLAIN
INFO:mail.log:Peer: ('172.22.0.1', 59474)
INFO:mail.log:('172.22.0.1', 59474) handling connection
INFO:mail.log:('172.22.0.1', 59474) >> b'EHLO localhost'
INFO:mail.log:('172.22.0.1', 59474) >> b'AUTH PLAIN'
WARNING:mail.log:Session.login_data is deprecated and will be removed in version 2.0
INFO:mail.log:('172.22.0.1', 59474) >> b'QUIT'
INFO:mail.log:('172.22.0.1', 59474) connection lost
INFO:mail.log:('172.22.0.1', 59474) Connection lost during _handle_client()

One of the software we are using, where the relay service works as expected, only produces the following log output:

INFO:mail.log:Available AUTH mechanisms: LOGIN PLAIN
INFO:mail.log:Peer: ('172.22.0.1', 36070)
INFO:mail.log:('172.22.0.1', 36070) handling connection
INFO:mail.log:('172.22.0.1', 36070) >> b'EHLO blau-weiss-stolberg.de'
INFO:mail.log:('172.22.0.1', 36070) >> b'QUIT'
INFO:mail.log:('172.22.0.1', 36070) connection lost
INFO:mail.log:('172.22.0.1', 36070) Connection lost during _handle_client()

The "AUTH PLAIN" message is missing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant