Nextcloud mail app config error

I’ve just tried on our installation, it works out of the box.

Just set the Host to “localhost” and use “user@domain” ads login.

I tried everything localhost, 127.0.0.1, Ip
“User@domain” “user”
Does not help
Authentication passes normally according to the logs
Mail content is not displayed.
the same error comes out

as I said, I launched two servers
and both set up the same
works on one

server 1 - nextcloud - mail application
connects to server 1 mail
cannot connect to server 2 mail

server 2 - nextcloud - mail application
connects to server 1 mail
cannot connect to server 2 mail

those. to server 2 can not connect from another server too

I have the same version of Nethserver and Nextcloud as @Bulat. I’ve enabled the Nextcloud Mail app and followed the suggestings from @giacomo and @pagaille in setting up my mail account in Settings. I’m getting similar errors related to permission in my Nextcloud Logging. Perhaps @giacomo you had horde installed on your Nethserver previously and that’s why you don’t see the errors we see?

[mail] Error: Horde_Imap_Client_Exception_ServerResponse: You do not have adequate permissions to carry out this operation. at <<closure>>

 0. /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php line 4569
    _responseCode(Horde_Imap_Clien ... }}, Horde_Imap_Clien ... }})
 1. /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php line 4317
    _getLine(Horde_Imap_Clien ... }})
 2. /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php line 4245
    _sendCmdChunk(Horde_Imap_Clien ... }}, [Horde_Imap_Clie ... }])
 3. /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php line 1754
    _sendCmd(Horde_Imap_Clien ... }})
 4. /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php line 1733
    _status([Horde_Imap_Client_Mailbox {}], 8717)
 5. /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php line 4038
    status(["Public"], 8717)
 6. /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php line 3590
    _syncStatus("Public")
 7. /usr/share/nextcloud/apps/mail/lib/IMAP/FolderMapper.php line 69
    getSyncToken("Public")
 8. /usr/share/nextcloud/apps/mail/lib/Service/MailManager.php line 87
    getFolders(OCA\Mail\Account {}, Horde_Imap_Clien ... e})
 9. /usr/share/nextcloud/apps/mail/lib/Controller/FoldersController.php line 74
    getFolders(OCA\Mail\Account {})
10. /usr/share/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 166
    index(4)
11. /usr/share/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 99
    executeController(OCA\Mail\Controller\FoldersController {}, "index")
12. /usr/share/nextcloud/lib/private/AppFramework/App.php line 118
    dispatch(OCA\Mail\Controller\FoldersController {}, "index")
13. /usr/share/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    main("OCA\\Mail\\Cont ... r", "index", OC\AppFramework\ ... {}, {accountId: "4", ... "})
14. <<closure>>
    __invoke({accountId: "4", ... "})
15. /usr/share/nextcloud/lib/private/Route/Router.php line 297
    call_user_func(OC\AppFramework\ ... {}, {accountId: "4", ... "})
16. /usr/share/nextcloud/lib/base.php line 987
    match("/apps/mail/api/accounts/4/folders")
17. /usr/share/nextcloud/index.php line 42
    handleRequest()

GET /nextcloud/index.php/apps/mail/api/accounts/4/folders
from 10.21.31.2 by 27F9C913-0BE4-497E-BE67-992F307B8378 at 2019-04-18T02:16:51+00:00

Thank you.

No I don’t.

You should asks the Nextcloud forum since the problem is application specific.

1 Like

Thanks @giacomo for the reply. I’ll open a post at Nextcloud or with the Mail App team.

Thank you.

1 Like

For the record, I tried to configure it again here and I got the same error message. It worked for a minute then stopped. Strange issue.

SOLVED : Just disable the shared mailboxes !

The problem is that nextcloud’s client lists all the folders of the server when connecting. That’s all right but for the Public folder the server answers permission denied. (maybe that’s the root cause @giacomo ?)

Here’s the wireshark decode :

3 Likes

Case opened : https://github.com/nextcloud/mail/issues/1730

3 Likes

It seems strange to me, I tried it with shared mailboxes and it worked …

:thinking:

I tested both on my production machine and on a freshly installed VM.

Do you also get the NOPERM answer when querying the server using the STATUS command ?

# telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
. LOGIN matthieu@mydomain.tld password
. STATUS Public (MESSAGES)
. NO [NOPERM] Permission denied (0.001 + 0.000 secs).

The developper of the Mail app answered that the version shipped with NC 15 is outdated (0.11.1). I should try with 0.14 but must update to NC 16 first, which is not available yet on nethserver.

Same with NC16 / Mail 0.14

1 Like

No, I get this:

. STATUS Public (MESSAGES)
* STATUS Public (MESSAGES 0)
. OK Status completed (0.002 + 0.000 + 0.001 secs).

Still from NC 16 I can’t read the content of a message inside a public folder.
But since all other clients are working, this should be a bug on the Mail app itself.

:thinking: how come we don’t have the same behaviour ? After all there isn’t much parameters when creating a shared mailbox ? All my test and production machines behave the same.

Anyway the mail app should probably handle this correctly.

1 Like

That’s a question for @davidep. But we did some experiments on our server and maybe it’s not 100% like a clean machine.

Try to run

/etc/e-smith/events//nethserver-mail-server-update/S98nethserver-mail-server-init-acl --force

See if the STATUS command now succeedes

1 Like

Thanks @davidep

–> . NO [NOPERM] Permission denied (0.001 + 0.000 secs).

Thank you very much @giacomo
This solved my problem
In the “shared mailboxes” I had a folder “Junk” which was created when installing the package nethserver-mail-quarantine
or can it manually

I can not remove “Junk” through the web panel
I deleted “Junk” via ssh console
and it all worked

/ etc / e-smith / events // nethserver-mail-server-update / S98nethserver-mail-server-init-acl --force

This request returns the same answer on both servers

[NOTICE] Initialize ACLs of Public (vmail) IMAP namespace

p.s. when adding a shared mailbox
problem comes back

2 Likes

Hi,

I am not shure, but for my feeling, it has something to do with this here:

-> Maybe the forbidden ACL leads to the same error, however with a larger impact on the nextcloud client. I am more and more convinced that may be solved on the Dovecot level. Maybe it could be worth giving a try to alter devecot ACL.

Best regards
Thorsten

… by the way, I have the same error here, but I can not swith of the shared folders as we use them wildly instead of forewarding single mails. :slight_smile:

Agreed. While some clients are more or less sensitive to the current ACL, even as an user it looks odd to not be able to list the root while the child nodes are.