nextcloud / nextcloud/mail

Self-hosted dovecot IMAP server cannot be registered

Open
#9,049 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. to triage bug
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Steps to reproduce
  1. Set up dovecot IMAP server using standard configuration with PAM authentication, test that dovecot authentication works with doveadm
  2. Try to register this on Nextcloud Mail
  3. Error message "There was an error while setting up your account"
Expected behavior

IMAP account should be registered and emails shown

Actual behavior

Error message "There was an error while setting up your account" is shown on registration screen.

Logs:

Exception: explode(): Argument #2 ($string) must be of type string, array given in file '/var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php' line 291

var/www/nextcloud/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1068:

OC\Route\Router->match()

/var/www/nextcloud/index.php - line 36:

OC::handleRequest()

Caused by TypeError: explode(): Argument #2 ($string) must be of type string, array given

    /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php - line 291:

    explode()

    /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php - line 4864:

    Horde_Imap_Client_Socket->_parseCapability()

    /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php - line 4611:

    Horde_Imap_Client_Socket->_responseCode()

    /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php - line 4348:

    Horde_Imap_Client_Socket->_getLine()

    /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php - line 4276:

    Horde_Imap_Client_Socket->_sendCmdChunk()

    /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php - line 884:

    Horde_Imap_Client_Socket->_sendCmd()

    /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php - line 546:

    Horde_Imap_Client_Socket->_tryLogin("*** sensiti ... *")

    /var/www/nextcloud/apps/mail/lib/IMAP/ImapClientRateLimitingDecorator.php - line 73:

    Horde_Imap_Client_Socket->_login("*** sensiti ... *")

    /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Base.php - line 853:

    OCA\Mail\IMAP\ImapClientRateLimitingDecorator->_login("*** sensiti ... *")

    /var/www/nextcloud/apps/mail/lib/Service/SetupService.php - line 147:

    Horde_Imap_Client_Base->login("*** sensiti ... *")

    /var/www/nextcloud/apps/mail/lib/Service/SetupService.php - line 127:

    OCA\Mail\Service\SetupService->testConnectivity()

    /var/www/nextcloud/apps/mail/lib/Controller/AccountsController.php - line 388:

    OCA\Mail\Service\SetupService->createNewAccount("*** sensiti ... *")

    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 230:

    OCA\Mail\Controller\AccountsController->create("*** sensiti ... *")

    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 137:

    OC\AppFramework\Http\Dispatcher->executeController()

/var/www/nextcloud/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1068:

OC\Route\Router->match()

/var/www/nextcloud/index.php - line 36:

OC::handleRequest()
Mail app version

3.4.4

Mailserver or service

Dovecot

Operating system

Ubuntu 22.04

PHP engine version

PHP 8.2

Web server

Nginx

Database

PostgreSQL

Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Socket.php at line 291 and follow the parseCapability call in the reported stack trace. Review the connection path through apps/mail/lib/Service/SetupService.php, then reproduce registration against Dovecot; done means the account registers without the exception and emails are shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.