Skip to content

two IMAP servers #278

@ziblis

Description

@ziblis

How do I connect a second IMAP server for authentication?
Nextcloud Hub 25 Autumn (32.0.2)
Here's the config:

 'user_backends' =>
  array (
    0 =>
    array (
     'class' => '\\OCA\\UserExternal\\IMAP',
     'arguments' =>
      array (
        0 => 'mail.domain1.com',
        1 => 993,
        2 => 'ssl',
        3 => 'domain1.com',
        4 => false,
        5 => false,
        ),.
    ),
    1 =>
    array (
     'class' => '\\OCA\\UserExternal\\IMAP',
     'arguments' =>
     array (
       0 => 'mail.domain2.com',
       1 => 993,
       2 => 'ssl',
       3 => 'domain2.com',
       4 => false,
       5 => false,
       ),
     ),
   ),

User userx@domain1.com logs in normally.
User usery@domain2.com have error Internal Server Error
in nextcloud.log:
{"reqId":"16288Eia1QgwTtaMlrY0","level":3,"time":"2025-12-01T11:13:54+00:00","remoteAddr":"195.96.64.194","user":"--","app":"index","method":"POST","url":"/login","message":"Call to undefined method OC\\Server::getLogger() in file '/var/www/nextcloud/apps/user_external/lib/IMAP.php' line 74","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36","version":"32.0.2.2","exception":{"Exception":"Exception","Message":"Call to undefined method OC\\Server::getLogger() in file '/var/www/nextcloud/apps/user_external/lib/IMAP.php' line 74","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1061,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":150,"Previous":{"Exception":"Error","Message":"Call to undefined method OC\\Server::getLogger()","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":230,"function":"checkPassword","class":"OCA\\UserExternal\\IMAP","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/UidLoginCommand.php","line":29,"function":"checkPasswordNoLogging","class":"OC\\User\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":22,"function":"process","class":"OC\\Authentication\\Login\\UidLoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/UserDisabledCheckCommand.php","line":39,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":22,"function":"process","class":"OC\\Authentication\\Login\\UserDisabledCheckCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/PreLoginHookCommand.php","line":34,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/Chain.php","line":43,"function":"process","class":"OC\\Authentication\\Login\\PreLoginHookCommand","type":"->"},{"file":"/var/www/nextcloud/core/Controller/LoginController.php","line":353,"function":"process","class":"OC\\Authentication\\Login\\Chain","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":204,"function":"tryLogin","class":"OC\\Core\\Controller\\LoginController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1061,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/user_external/lib/IMAP.php","Line":74},"message":"Call to undefined method OC\\Server::getLogger() in file '/var/www/nextcloud/apps/user_external/lib/IMAP.php' line 74","exception":{},"CustomMessage":"Call to undefined method OC\\Server::getLogger() in file '/var/www/nextcloud/apps/user_external/lib/IMAP.php' line 74"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions