Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

You do not have adequate permissions to carry out this operation. #1541

Open
magixus opened this issue Feb 21, 2019 · 6 comments

Comments

Projects
None yet
3 participants
@magixus
Copy link

commented Feb 21, 2019

Steps to reproduce

  1. I've deployed nextcloud on my server (with sldap)
  2. configure mail in config.php like this 馃憤
'app.mail.accounts.default' =>array(
   'email' => '%EMAIL%',
   'imapHost' => 'mail.domain.com',
   'imapPort' => 993,
   'imapUser' => '%EMAIL%',
   'imapSslMode' => 'ssl',
   'smtpHost' => 'mail.domain.com',
   'smtpPort' => 587,
   'smtpUser' => '%EMAIL%',
   'smtpSslMode' => 'tls',
 ),
 'app.mail.transport' => 'php-mail',
  1. I used to try %USERID% but i get some errors. however with this configuration, it gives me the email and it's exaclty what I want .
    4- when i see the imap log this is what i get:
    Feb 21 08:43:24 centos dovecot: imap-login: Login: user=user@domain.com, method=PLAIN, rip=x.x.x.x, lip=x.x.x.x, mpid=28824, TLS, session=
    Feb 21 08:43:24 centos dovecot: imap(user@domain.com): Logged out in=576 out=1767

user is the username.
domain is my domain.
x.x.x.x are the local and public adress.

Expected behaviour

the proper behaviour would be to login my account and show emails

Actual behaviour

when use mail it show me that i don't have adequate permission for the operation

Error

Horde_Imap_Client_Exception_ServerResponse: You do not have adequate permissions to carry out this operation.
  at Horde_Imap_Client_Socket::_responseCode
     /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php, line 4561
  at Horde_Imap_Client_Socket::_getLine
     /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php, line 4309
  at Horde_Imap_Client_Socket::_sendCmdChunk
     /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php, line 4237
  at Horde_Imap_Client_Socket::_sendCmd
     /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php, line 1751
  at Horde_Imap_Client_Socket::_status
     /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php, line 1728
  at Horde_Imap_Client_Base::status
     /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php, line 4033
  at Horde_Imap_Client_Base::_syncStatus
     /usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php, line 3585
  at Horde_Imap_Client_Base::getSyncToken
     /usr/share/nextcloud/apps/mail/lib/IMAP/FolderMapper.php, line 69
  at OCA\Mail\IMAP\FolderMapper::getFolders
     /usr/share/nextcloud/apps/mail/lib/Service/MailManager.php, line 87
  at OCA\Mail\Service\MailManager::getFolders
     /usr/share/nextcloud/apps/mail/lib/Controller/FoldersController.php, line 74
  at OCA\Mail\Controller\FoldersController::index
     /usr/share/nextcloud/lib/private/AppFramework/Http/Dispatcher.php, line 166
  at OC\AppFramework\Http\Dispatcher::executeController
     /usr/share/nextcloud/lib/private/AppFramework/Http/Dispatcher.php, line 99
  at OC\AppFramework\Http\Dispatcher::dispatch
     /usr/share/nextcloud/lib/private/AppFramework/App.php, line 118
  at OC\AppFramework\App::main
     /usr/share/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php, line 47
  at OC\AppFramework\Routing\RouteActionHandler::__invoke
  at call_user_func
     /usr/share/nextcloud/lib/private/Route/Router.php, line 297
  at OC\Route\Router::match
     /usr/share/nextcloud/lib/base.php, line 987
  at OC::handleRequest
     /usr/share/nextcloud/index.php, line 42


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@ChristophWurst

This comment has been minimized.

Copy link
Member

commented Feb 21, 2019

The Nextcloud mail app offers an extensive logging system to make it easier identifying and tracking down bugs. Please enable debug mode and set the log level to debug in your admin settings. Then, try to reproduce your issue and take another look at data/nextcloud.log, data/horde_imap.log and data/horde_smtp.log.

Note that the logs may contain credentials (in a base64 encoded form) so don't post those lines here.

@magixus

This comment has been minimized.

Copy link
Author

commented Feb 24, 2019

Hey @ChristophWurst,
here's what those log files show:
1- ** nextcloud.log **

{"reqId":"xxxxxxxx","level":3,"time":"February 24, 2019 09:03:27","remoteAddr":"x.x.x.x","user":xxxxxxxxxxx","app":"mail","method":"GET","url":"\/index.php\/apps\/mail\/api\/accounts\/-2\/folders","message":{"Exception":"Horde_Imap_Client_Exception_ServerResponse","Message":"You do not have adequate permissions to carry out this operation.","Code":17,"Trace":[{"file":"\/usr\/share\/nextcloud\/apps\/mail\/vendor\/pear-pear.horde.org\/Horde_Imap_Client\/Horde\/Imap\/Client\/Socket.php","line":4561,"function":"_responseCode","class":"Horde_Imap_Client_Socket","type":"->","args":[{"data":{"modseqs":[],"modseqs_nouid":[]},"fetch":{"__class__":"Horde_Imap_Client_Fetch_Results"},"__class__":"Horde_Imap_Client_Interaction_Pipeline"},{"tag":"11","responseCode":{"data":[],"code":"NOPERM","__class__":"stdClass"},"status":3,"token":{"__class__":"Horde_Imap_Client_Tokenize"},"__class__":"Horde_Imap_Client_Interaction_Server_Tagged"}]},{"file":"\/usr\/share\/nextcloud\/apps\/mail\/vendor\/pear-pear.horde.org\/Horde_Imap_Client\/Horde\/Imap\/Client\/Socket.php","line":4309,"function":"_getLine","class":"Horde_Imap_Client_Socket","type":"->","args":[{"data":{"modseqs":[],"modseqs_nouid":[]},"fetch":{"__class__":"Horde_Imap_Client_Fetch_Results"},"__class__":"Horde_Imap_Client_Interaction_Pipeline"}]},{"file":"\/usr\/share\/nextcloud\/apps\/mail\/vendor\/pear-pear.horde.org\/Horde_Imap_Client\/Horde\/Imap\/Client\/Socket.php","line":4237,"function":"_sendCmdChunk","class":"Horde_Imap_Client_Socket","type":"->","args":[{"data":{"modseqs":[],"modseqs_nouid":[]},"fetch":{"__class__":"Horde_Imap_Client_Fetch_Results"},"__class__":"Horde_Imap_Client_Interaction_Pipeline"},[{"debug":[],"literalplus":true,"literal8":false,"on_error":{"__class__":"Closure"},"on_success":null,"pipeline":{"data":{"modseqs":[],"modseqs_nouid":[]},"fetch":{"__class__":"Horde_Imap_Client_Fetch_Results"},"__class__":"Horde_Imap_Client_Interaction_Pipeline"},"response":{"tag":"11","responseCode":{"data":[],"code":"NOPERM","__class__":"stdClass"},"status":3,"token":{"__class__":"Horde_Imap_Client_Tokenize"},"__class__":"Horde_Imap_Client_Interaction_Server_Tagged"},"tag":"11","__class__":"Horde_Imap_Client_Interaction_Command"}]]},{"file":"\/usr\/share\/nextcloud\/apps\/mail\/vendor\/pear-pear.horde.org\/Horde_Imap_Client\/Horde\/Imap\/Client\/Socket.php","line":1751,"function":"_sendCmd","class":"Horde_Imap_Client_Socket","type":"->","args":[{"data":{"modseqs":[],"modseqs_nouid":[]},"fetch":{"__class__":"Horde_Imap_Client_Fetch_Results"},"__class__":"Horde_Imap_Client_Interaction_Pipeline"}]},{"file":"\/usr\/share\/nextcloud\/apps\/mail\/vendor\/pear-pear.horde.org\/Horde_Imap_Client\/Horde\/Imap\/Client\/Base.php","line":1728,"function":"_status","class":"Horde_Imap_Client_Socket","type":"->","args":[[{"__class__":"Horde_Imap_Client_Mailbox"}],8717]},{"file":"\/usr\/share\/nextcloud\/apps\/mail\/vendor\/pear-pear.horde.org\/Horde_Imap_Client\/Horde\/Imap\/Client\/Base.php","line":4033,"function":"status","class":"Horde_Imap_Client_Base","type":"->","args":[["Public"],8717]},{"file":"\/usr\/share\/nextcloud\/apps\/mail\/vendor\/pear-pear.horde.org\/Horde_Imap_Client\/Horde\/Imap\/Client\/Base.php","line":3585,"function":"_syncStatus","class":"Horde_Imap_Client_Base","type":"->","args":["Public"]},{"file":"\/usr\/share\/nextcloud\/apps\/mail\/lib\/IMAP\/FolderMapper.php","line":69,"function":"getSyncToken","class":"Horde_Imap_Client_Base","type":"->","args":["Public"]},{"file":"\/usr\/share\/nextcloud\/apps\/mail\/lib\/Service\/MailManager.php","line":87,"function":"getFolders","class":"OCA\\Mail\\IMAP\\FolderMapper","type":"->","args":[{"__class__":"OCA\\Mail\\Account"},{"cacheFields":{"9":"HICenv","10":"HICflags","8":"HIChdrs","11":"HICdate","12":"HICsize","1":"HICstruct"},"changed":true,"statuscache":true,"__class__":"Horde_Imap_Client_Socket"}]},{"file":"\/usr\/share\/nextcloud\/apps\/mail\/lib\/Controller\/FoldersController.php","line":74,"function":"getFolders","class":"OCA\\Mail\\Service\\MailManager","type":"->","args":[{"__class__":"OCA\\Mail\\Account"}]},{"file":"\/usr\/share\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"index","class":"OCA\\Mail\\Controller\\FoldersController","type":"->","args":[-2]},{"file":"\/usr\/share\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Mail\\Controller\\FoldersController"},"index"]},{"file":"\/usr\/share\/nextcloud\/lib\/private\/AppFramework\/App.php","line":118,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Mail\\Controller\\FoldersController"},"index"]},{"file":"\/usr\/share\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Mail\\Controller\\FoldersController","index",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"accountId":"-2","_route":"mail.folders.index"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"accountId":"-2","_route":"mail.folders.index"}]},{"file":"\/usr\/share\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"accountId":"-2","_route":"mail.folders.index"}]},{"file":"\/usr\/share\/nextcloud\/lib\/base.php","line":987,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/apps\/mail\/api\/accounts\/-2\/folders"]},{"file":"\/usr\/share\/nextcloud\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"\/usr\/share\/nextcloud\/apps\/mail\/vendor\/pear-pear.horde.org\/Horde_Imap_Client\/Horde\/Imap\/Client\/Socket.php","Line":5057,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/71.0.3578.98 Safari\/537.36 OPR\/58.0.3135.53","version":"15.0.4.0"}

2- ** horde_imap.log **

>> Wed, 20 Feb 2019 15:51:03 +0000
>> Connection to: imap://mail.mydomain.com:993/
>> Server connection took 0.0531 seconds.
S: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
C: 1 AUTHENTICATE PLAIN [INITIAL CLIENT RESPONSE (username: user@mydomain.com)]
S: 1 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY SPECIAL-USE QUOTA ACL RIGHTS=texk] Logged in
>> Command 1 took 0.0775 seconds.
>> CACHE: Using the OCA\Mail\Cache\Cache storage driver.
C: 2 ENABLE QRESYNC
C: 3 LOGOUT
S: * ENABLED QRESYNC
S: 2 OK Enabled (0.001 + 0.000 secs).
>> Command 2 took 0.0015 seconds.
S: * BYE Logging out
S: 3 OK Logout completed (0.001 + 0.000 secs).
>> Command 3 took 0.0015 seconds.

3- ** horde_smtp.log **
I couldn't find this file in my system
tried : find / *horde_smtp* ...=> no results

@no-response no-response bot removed the needs info label Feb 24, 2019

@ChristophWurst

This comment has been minimized.

Copy link
Member

commented Feb 25, 2019

Those logs look fine. To not find SMTP logs is to be expected when it fails with IMAP before.

@magixus

This comment has been minimized.

Copy link
Author

commented Feb 25, 2019

still can not log any user to mail.

@ChristophWurst

This comment has been minimized.

Copy link
Member

commented Feb 25, 2019

This could be an issue with the IMAP server https://lists.horde.org/archives/imp/Week-of-Mon-20130225/054657.html. Doe the app work with a different one?

Just for clarification. After you reproduce the error, your IMAP log still does not contain any more info? I would assume that this error is somehow noticeable in the logs but the communication you posted looks clean.

@dagtk05

This comment has been minimized.

Copy link

commented Mar 31, 2019

I have the same problem, but I did not understand how to solve it.
It is clear that the problem is not in the mail application, but on the server.
There are two servers that are the same set up, running on the same server, not on the other server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.