Expected behavior
Users that login with an account that is not an IMAP account (or can not be reached for whatever reason) should not see an E-Mail mailbox. If the IMAP account can be reached, the mailbox should be shown.
Auto account detection is configured as described here https://github.com/nextcloud/mail/blob/master/doc/admin.md
This worked as expected until NC 14, but not after upgrading to NC 16 (not tested in NC 15).
Actual behavior
When opening the Mail App, an error screen appears, if the user has logged in with credentials that do not map to an existing IMAP account. Log says:
GET /nextcloud/index.php/apps/mail/
from ... at 2019-06-24T09:57:02+00:00
[index] Error: Error: Call to undefined method stdClass::write() at <>
/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php line 4298
Horde_Imap_Client_Socket->_processCmd(Horde_Imap_Clien ... }}, Horde_Imap_Clien ... "}, Horde_Imap_Clien ... "})
/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php line 4245
Horde_Imap_Client_Socket->_sendCmdChunk(Horde_Imap_Clien ... }}, [Horde_Imap_Clie ... }])
/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php line 849
Horde_Imap_Client_Socket->_sendCmd(Horde_Imap_Clien ... }})
/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php line 512
Horde_Imap_Client_Socket->_tryLogin("*** sensitive parameters replaced ***")
/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php line 838
Horde_Imap_Client_Socket->_login("*** sensitive parameters replaced ***")
/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php line 1389
Horde_Imap_Client_Base->login("*** sensitive parameters replaced ***")
/var/www/nextcloud/apps/mail/lib/IMAP/FolderMapper.php line 51
Horde_Imap_Client_Base->listMailboxes("*", 4, {delimiter: true ... e})
/var/www/nextcloud/apps/mail/lib/Service/MailManager.php line 69
OCA\Mail\IMAP\FolderMapper->getFolders(OCA\Mail\Account {}, Horde_Imap_Clien ... e})
/var/www/nextcloud/apps/mail/lib/Controller/PageController.php line 111
OCA\Mail\Service\MailManager->getFolders(OCA\Mail\Account {})
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 166
OCA\Mail\Controller\PageController->index()
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 99
OC\AppFramework\Http\Dispatcher->executeController(OCA\Mail\Controller\PageController {}, "index")
/var/www/nextcloud/lib/private/AppFramework/App.php line 126
OC\AppFramework\Http\Dispatcher->dispatch(OCA\Mail\Controller\PageController {}, "index")
/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
OC\AppFramework\App::main("OCA\Mail\Controller\PageController", "index", OC\AppFramework\ ... {}, {_route: "mail.page.index"})
<>
OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: "mail.page.index"})
/var/www/nextcloud/lib/private/Route/Router.php line 297
undefinedundefinedcall_user_func(OC\AppFramework\ ... {}, {_route: "mail.page.index"})
/var/www/nextcloud/lib/base.php line 975
OC\Route\Router->match("/apps/mail/")
/var/www/nextcloud/index.php line 42
OC::handleRequest()
Mail app
Mail app version: 0.15.1
Mailserver or service: own dovecot mail server on separate VM
Server configuration
Nextcloud Version: 16.0.1
Proposal
Extend app.mail.accounts.default array with a parameter which lists the domains, under which an IMAP login is being tried. This is required for nextclouds where users may use various types of credentials provided by a Single-Sign-On service, mapped against LDAP etc.
Expected behavior
Users that login with an account that is not an IMAP account (or can not be reached for whatever reason) should not see an E-Mail mailbox. If the IMAP account can be reached, the mailbox should be shown.
Auto account detection is configured as described here https://github.com/nextcloud/mail/blob/master/doc/admin.md
This worked as expected until NC 14, but not after upgrading to NC 16 (not tested in NC 15).
Actual behavior
When opening the Mail App, an error screen appears, if the user has logged in with credentials that do not map to an existing IMAP account. Log says:
Mail app
Mail app version: 0.15.1
Mailserver or service: own dovecot mail server on separate VM
Server configuration
Nextcloud Version: 16.0.1
Proposal
Extend
app.mail.accounts.defaultarray with a parameter which lists the domains, under which an IMAP login is being tried. This is required for nextclouds where users may use various types of credentials provided by a Single-Sign-On service, mapped against LDAP etc.