"lookup-only" permission on a folder breaks communication with server. (IMAP error reported by server.)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
Steps to reproduce
- Set permissions to l (lookup only) on a single folder (on an Cyrus IMAP Server)
- No folders and no mails are shown
Expected behaviour
should show folders and emails, even if there is one folder with only lookup permissions.
if there are no read permissions on a listed folder nextcloud should not disconnect, but move on to the next folder.
Actual behaviour
everything keeps blank, showing the message "loading accounts" forever, on top it shows "unknown Error".
the problem persists if the folder is not subscribed at all.
it seems like the mail client issues a STATUS request on the mentioned folder, the server answers with "no permission" and nextcloud issues a logout.
Error
Horde_Imap_Client_Exception_ServerResponse: IMAP error reported by server.
at Horde_Imap_Client_Socket::_getLine
/net/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php, line 4302
at Horde_Imap_Client_Socket::_sendCmdChunk
/net/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php, line 4230
at Horde_Imap_Client_Socket::_sendCmd
/net/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php, line 1751
at Horde_Imap_Client_Socket::_status
/net/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php, line 1728
at Horde_Imap_Client_Base::status
/net/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php, line 4033
at Horde_Imap_Client_Base::_syncStatus
/net/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php, line 3585
at Horde_Imap_Client_Base::getSyncToken
/net/www/nextcloud/apps/mail/lib/IMAP/FolderMapper.php, line 65
at OCA\Mail\IMAP\FolderMapper::getFolders
/net/www/nextcloud/apps/mail/lib/Service/MailManager.php, line 84
at OCA\Mail\Service\MailManager::getFolders
/net/www/nextcloud/apps/mail/lib/Controller/FoldersController.php, line 72
at OCA\Mail\Controller\FoldersController::index
at call_user_func_array
/net/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php, line 161
at OC\AppFramework\Http\Dispatcher::executeController
/net/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php, line 91
at OC\AppFramework\Http\Dispatcher::dispatch
/net/www/nextcloud/lib/private/AppFramework/App.php, line 115
at OC\AppFramework\App::main
/net/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php, line 47
at OC\AppFramework\Routing\RouteActionHandler::__invoke
at call_user_func
/net/www/nextcloud/lib/private/Route/Router.php, line 297
at OC\Route\Router::match
/net/www/nextcloud/lib/base.php, line 999
at OC::handleRequest
/net/www/nextcloud/index.php, line 42
conversation nextcloud< - >cyrus:
<1528817613<31 STATUS "Projekte.082.08292 AAA Blabla" (MESSAGES UIDNEXT UIDVALIDITY HIGHESTMODSEQ)
>1528817613>31 NO Permission denied
<1528817613<32 LOGOUT
>1528817613>* BYE LOGOUT received
32 OK Completed
when changing the folders permisson to e.g. lrswipcda everything works fine.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/mail/lib/IMAP/FolderMapper.php, following the STATUS failure through MailManager::getFolders and FoldersController::index. Reproduce the Cyrus IMAP lookup-only case and inspect how the Horde IMAP error is handled. Done means a permission-denied STATUS response does not log out or leave the account loading forever, while other folders remain available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100