Problem with connect to imap folders w/o read permision

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version: 22.2.0
Operating system and version: CentOS
Apache or nginx version:
PHP version:
IMAP server on dovecot:
Pigeonhole version 0.4.20 (7cd71ba)
OS: Linux 3.10.0-693.11.6.el7.x86_64 x86_64 CentOS Linux release 7.4.1708 (Core)

The issue you are facing: when a shared folder in public or individual mailbox do not has read ACL I can not add the mail account which has access to the folder. I get “Unexpected error during account creation”. I can be a dropbox type permission “lookup post insert write” or even all permission w/o read “lookup post insert write write-seen write-deleted expunge create admin”.

Is this the first time you’ve seen this error? Y

Steps to replicate it, Scenario 1:

  1. Remove an email account in mailapp
  2. Remove imap read permission to a folder - no mater if it is shared from a user, public or simply your own
  3. Try to add email account in mailapp
  4. You should get “Unexpected error during account creation”

Scenario 2:

  1. having an configured mail account
  2. remove a read permission to a folder
  3. try to browse the folder
  4. you get never ending reading try

The output of your Nextcloud log in Admin > Logging:

[mail] Error: IMAP error synchronizing account 83: You do not have adequate permissions to carry out this operation.
GET /apps/mail/api/mailboxes?accountId=83
from 172.20.0.2 by cd3fa3e2-1c50-1037-95c5-59c9f4293743 at 2021-12-16T08:21:05+00:00

Affected as well for Nextcloud version: 23.0.0

Sounds like Mail can't connect when user has no permission on one of the folders · Issue #1735 · nextcloud/mail · GitHub

Sounds only. I doubled check I picked a folder and set only lookup read rights on that. This did not blocked the account setup. When I setup lookup post insert write write-seen write-deleted expunge create admin- w/o read - it makes a problem.

I guess that during setup or work mailapp tries to read, fetch messages. When it can’t it gives an error or is not timeout limited.

You mentioned about an issue about any IMAP missing privilage - I am quite sure that is about read right.