the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
994 stars 120 forks source link

Could not determine/connect to server #1599

Open UltraBlackLinux opened 4 months ago

UltraBlackLinux commented 4 months ago

Describe the bug Whenever I try to log in, it sais unknown error and I get an error in the nextcloud logs

To Reproduce try to log in

Expected behavior it should let me log in

Please complete the following information:

Debug/logging information Place them here (few lines) or as attachments (many lines)

Hold on a minute you should warn users before doing this because this almost just leaked my username and password to my mail account!

``` [2024-05-26 18:53:23.319][7068560b] PHP[WARNING]: Undefined variable $oc /mnt/ncdata/appdata_snappymail/_data_/_default_/plugins/nextcloud/index.php [line:84, code:2] [2024-05-26 18:53:23.320][7068560b] PHP[WARNING]: Attempt to read property "user" on null /mnt/ncdata/appdata_snappymail/_data_/_default_/plugins/nextcloud/index.php [line:84, code:2] [2024-05-26 18:53:28.248][7068560b] SERVICE[WARNING]: Call to a member function getPrimaryEMailAddress() on null #0 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Plugins/Manager.php(312): NextcloudPlugin->loginCredentials2('address', 'password') #1 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Actions/UserAuth.php(102): RainLoop\Plugins\Manager->RunHook('login.credentia...', Array) #2 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Actions/UserAuth.php(133): RainLoop\Actions->resolveLoginCredentials('address..', Object(SnappyMail\SensitiveString)) #3 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Actions/User.php(39): RainLoop\Actions->LoginProcess('adrress...', Object(SnappyMail\SensitiveString)) #4 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/ServiceActions.php(134): RainLoop\Actions->DoLogin() #5 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson('') #6 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult() #7 /var/www/html/custom_apps/snappymail/lib/Util/SnappyMailHelper.php(119): RainLoop\Service::Handle() #8 /var/www/html/custom_apps/snappymail/lib/Controller/PageController.php(115): OCA\SnappyMail\Util\SnappyMailHelper::startApp(true) #9 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(232): OCA\SnappyMail\Controller\PageController->indexPost() #10 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(138): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\SnappyMail\Controller\PageController), 'indexPost') #11 /var/www/html/lib/private/AppFramework/App.php(184): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\SnappyMail\Controller\PageController), 'indexPost') #12 /var/www/html/lib/private/Route/Router.php(338): OC\AppFramework\App::main('PageController', 'indexPost', Object(OC\AppFramework\DependencyInjection\DIContainer), Array) #13 /var/www/html/lib/base.php(1050): OC\Route\Router->match('/apps/snappymai...') #14 /var/www/html/index.php(49): OC::handleRequest() #15 {main} [2024-05-26 18:54:10.950][c2f1d95d] PHP[WARNING]: Undefined variable $oc /mnt/ncdata/appdata_snappymail/_data_/_default_/plugins/nextcloud/index.php [line:84, code:2] [2024-05-26 18:54:10.950][c2f1d95d] PHP[WARNING]: Attempt to read property "user" on null /mnt/ncdata/appdata_snappymail/_data_/_default_/plugins/nextcloud/index.php [line:84, code:2] ```

Additional context literally just installed it, on a fresh AIO container.

Edit: I had another read through the exception and was finally able to find a place to add an email address for the user account. I did that and now the error has changed. The verification tool verified them successfully so no idea what that's about...

``` Next MailSo\Imap\Exceptions\LoginBadCredentialsException: failed: Could not connect to server in /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/MailSo/Imap/ImapClient.php:232 Stack trace: #0 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Model/Account.php(264): MailSo\Imap\ImapClient->Login(Object(MailSo\Imap\Settings)) #1 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Model/Account.php(206): RainLoop\Model\Account->netClientLogin(Object(MailSo\Imap\ImapClient), Object(RainLoop\Plugins\Manager)) #2 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Actions/UserAuth.php(444): RainLoop\Model\Account->ImapConnectAndLogin(Object(RainLoop\Plugins\Manager), Object(MailSo\Imap\ImapClient), Object(RainLoop\Config\Application)) #3 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Actions/UserAuth.php(159): RainLoop\Actions->imapConnect(Object(RainLoop\Model\MainAccount), true) #4 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Actions/User.php(39): ```

It seems to be randomly fluctuating between that and "could not determine domain" (which I also noticed earlier as it repeatedly failed to find the domain in the domain tester...)

Next MailSo\Imap\Exceptions\LoginBadCredentialsException:  failed: Could not determine server in /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/MailSo/Imap/ImapClient.php:232
Stack trace:
#0 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Model/Account.php(264): MailSo\Imap\ImapClient->Login(Object(MailSo\Imap\Settings))
#1 /var/www/html/custom_apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Model/Account.php(206): RainLoop\Model\Account->netClientLogin(Object(MailSo\Imap\ImapClient), Object(RainLoop\Plugins\Manager))
HenkVirtual commented 4 months ago

I also encounter login failures. but as far as i can see snappymail strips the domain-part from the username ( the main mailbox ). At least this is what i can see in my dovecot logging. just upgraded to 2.36.2

FelixDefrance commented 4 months ago

In my case, snappymail use the nextcloud login instead of mail profile as I defined in my nextcloud profile.