nextcloud / user_external

👥 External user authentication methods like IMAP, SMB and FTP
https://apps.nextcloud.com/apps/user_external
107 stars 64 forks source link

IMAP doesn't work #237

Closed jonas-krug closed 10 months ago

jonas-krug commented 10 months ago

I have the right creds inserted into config.php

'user_backends' => array(
    array(
        'class' => '\OCA\UserExternal\IMAP',
        'arguments' => array(
            'IMAP-DOMAIN', 993, 'tls', null, true, false
        ),
    ),
  ),

I got the following error, if I try to login with creds from Dovecot/Postfix:

ERROR: Could not connect to imap server via curl: Operation timed out after 10001 milliseconds with 0 out of 0 bytes received

This works:

curl -v -u 'MAIL:PW' imaps://SERVER/INBOX?NEW

After reload Nextcloud I get everytime following "Warning":

Can not determine user count for OCA\UserExternal\IMAP

Server configuration

User External App version: 3.2.0

Operating system: Ubuntu 20.04

Web server: apache2 - 2.4.41

Database: mariadb 10.3

PHP version: 8.2.9

Nextcloud version: 27.0.2

List of activated apps:

App list ``` - activity: 2.19.0 - announcementcenter: 6.6.2 - bruteforcesettings: 2.7.0 - calendar: 4.4.4 - circles: 27.0.1 - cloud_federation_api: 1.10.0 - comments: 1.17.0 - contacts: 5.3.2 - contactsinteraction: 1.8.0 - dashboard: 7.7.0 - dav: 1.27.0 - encryption: 2.15.0 - federatedfilesharing: 1.17.0 - federation: 1.17.0 - files: 1.22.0 - files_antivirus: 5.2.1 - files_automatedtagging: 1.17.0 - files_pdfviewer: 2.8.0 - files_rightclick: 1.6.0 - files_sharing: 1.19.0 - files_trashbin: 1.17.0 - files_versions: 1.20.0 - firstrunwizard: 2.16.0 - groupfolders: 15.0.2 - logreader: 2.12.0 - lookup_server_connector: 1.15.0 - nextcloud_announcements: 1.16.0 - notifications: 2.15.0 - oauth2: 1.15.1 - password_policy: 1.17.0 - photos: 2.3.0 - privacy: 1.11.0 - provisioning_api: 1.17.0 - quota_warning: 1.17.0 - recommendations: 1.6.0 - related_resources: 1.2.0 - richdocuments: 8.1.1 - richdocumentscode: 23.5.202 - serverinfo: 1.17.0 - settings: 1.9.0 - sharebymail: 1.17.0 - socialsharing_email: 2.6.0 - support: 1.10.0 - survey_client: 1.15.0 - suspicious_login: 5.0.0 - systemtags: 1.17.0 - text: 3.8.0 - theming: 2.2.0 - twofactor_backupcodes: 1.16.0 - twofactor_totp: 9.0.0 - unroundedcorners: 1.0.9 - updatenotification: 1.17.0 - user_external: 3.2.0 - user_status: 1.7.0 - users_picker: 0.2.2 - viewer: 2.1.0 - weather_status: 1.7.0 - workflowengine: 2.9.0 ```

Nextcloud configuration:

Config report ``` { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "***REMOVED SENSITIVE VALUE***" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "27.0.2.1", "overwrite.cli.url": "https:\/\/cloud.krugson.net", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "theme": "", "loglevel": 2, "maintenance": false, "mysql.utf8mb4": true, "default_phone_region": "DE", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_sendmailmode": "smtp", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpauth": 1, "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "memcache.local": "\\OC\\Memcache\\APCu", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 6379 }, "app_install_overwrite": [ "apporder" ], "twofactor_enforced": "true", "twofactor_enforced_groups": [ "admin" ], "twofactor_enforced_excluded_groups": [], "updater.secret": "***REMOVED SENSITIVE VALUE***", "user_backends": [ { "class": "\\OCA\\UserExternal\\IMAP", "arguments": [ "***REMOVED SENSITIVE VALUE***", 993, "tls", null, true, false ] } ] } } ```
jonas-krug commented 10 months ago

after first login, error not coming up again

pierrecorsini commented 9 months ago

@jonas-krug Any hint on the resolution of your issue ? I have the same problem.

damnms commented 7 months ago

also have the same problem, curl on the command line works like a charm

nshah14285 commented 3 months ago

I faced the same problem, using Nextcloud 28.0.3, PHP 8.2. Solved the issue by replacing 'tls' with 'ssl' in the settings and it worked. I hope this helps you.