user_external icon indicating copy to clipboard operation
user_external copied to clipboard

ERROR: Could not connect to imap server via curl

Open internethering opened this issue 2 years ago • 1 comments

I want to add https://<domain>/remote.php/dav/ to a client with an user added in nextcloud interface, not an imap user one. I get:

{"reqId":"ZFJxBAOzaQ4z8pEBv7FpwwAAAiw","level":3,"time":"2023-05-03T14:35:12+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***2a01:4f9:2b:2a8b::defe:c8ed","user":"--","app":"user_external","method":"PROPFIND","url":"/remote.php/dav/","message":"ERROR: Could not connect to imap server via curl: ","userAgent":"sabre-dav/4.4.0 (http://sabre.io/)","version":"25.0.6.1","data":{"app":"user_external"}}
{"reqId":"ZFJxBAOzaQ4z8pEBv7FpwwAAAiw","level":3,"time":"2023-05-03T14:35:14+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"--","app":"user_external","method":"PROPFIND","url":"/remote.php/dav/","message":"ERROR: Could not connect to imap server via curl: ","userAgent":"sabre-dav/4.4.0 (http://sabre.io/)","version":"25.0.6.1","data":{"app":"user_external"}}
{"reqId":"ZFJxBAOzaQ4z8pEBv7FpwwAAAiw","level":2,"time":"2023-05-03T14:35:14+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"--","app":"core","method":"PROPFIND","url":"/remote.php/dav/","message":"Login failed: '<nextcloud user>' (Remote IP: '***REMOVED SENSITIVE VALUE***')","userAgent":"sabre-dav/4.4.0 (http://sabre.io/)","version":"25.0.6.1","data":{"app":"core"}}

With imap users It work as expected.

Server configuration

User External App version: 3.1.0 Operating system: Gentoo Base System release 2.13 Web server: Apache 2.4.55 Database: MySQL 8.0.32 PHP version: 8.0 Nextcloud version: 25.0.6 Updated from an older Nextcloud/ownCloud or fresh install: 25.0.5 Where did you install Nextcloud from: source

Signing status:

Signing status
No errors have been found.

List of activated apps:

App list
Enabled:
  - activity: 2.17.0
  - bruteforcesettings: 2.5.0
  - calendar: 4.3.1
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - comments: 1.15.0
  - contacts: 5.2.0
  - dav: 1.24.0
  - federatedfilesharing: 1.15.0
  - federation: 1.15.0
  - files: 1.20.1
  - files_external: 1.17.0
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - firstrunwizard: 2.14.0
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - nextcloud_announcements: 1.14.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - password_policy: 1.15.0
  - photos: 2.0.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - recommendations: 1.4.0
  - related_resources: 1.0.4
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - support: 1.8.0
  - survey_client: 1.13.0
  - systemtags: 1.15.0
  - tasks: 0.14.5
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - updatenotification: 1.15.0
  - user_external: 3.1.0
  - user_status: 1.5.0
  - viewer: 1.9.0
  - workflowengine: 2.7.0

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "25.0.5.1",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "trashbin_retention_obligation": "auto, 7",
        "filelocking.enabled": "true",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\APCu",
        "user_backends": [
            {
                "class": "\\OCA\\UserExternal\\IMAP",
                "arguments": [
                    "***REMOVED SENSITIVE VALUE***",
                    993,
                    "ssl"
                ]
            }
        ],
        "loglevel": 2,
        "maintenance": false,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "enable_avatars": true,
        "singleuser": false,
        "updater.release.channel": "stable",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_smtpport": "25",
        "encryption.legacy_format_support": false,
        "encryption.key_storage_migrated": false,
        "default_phone_region": "DE",
        "app_install_overwrite": [
            "user_external"
        ]
    }
}

Logs

Web server error log

Web server error log
no error log for this issue

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"ZFJxBAOzaQ4z8pEBv7FpwwAAAiw","level":3,"time":"2023-05-03T14:35:12+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***2a01:4f9:2b:2a8b::defe:c8ed","user":"--","app":"user_external","method":"PROPFIND","url":"/remote.php/dav/","message":"ERROR: Could not connect to imap server via curl: ","userAgent":"sabre-dav/4.4.0 (http://sabre.io/)","version":"25.0.6.1","data":{"app":"user_external"}}
{"reqId":"ZFJxBAOzaQ4z8pEBv7FpwwAAAiw","level":3,"time":"2023-05-03T14:35:14+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"--","app":"user_external","method":"PROPFIND","url":"/remote.php/dav/","message":"ERROR: Could not connect to imap server via curl: ","userAgent":"sabre-dav/4.4.0 (http://sabre.io/)","version":"25.0.6.1","data":{"app":"user_external"}}
{"reqId":"ZFJxBAOzaQ4z8pEBv7FpwwAAAiw","level":2,"time":"2023-05-03T14:35:14+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"--","app":"core","method":"PROPFIND","url":"/remote.php/dav/","message":"Login failed: '<nextcloud user>' (Remote IP: '***REMOVED SENSITIVE VALUE***')","userAgent":"sabre-dav/4.4.0 (http://sabre.io/)","version":"25.0.6.1","data":{"app":"core"}}

internethering avatar May 03 '23 14:05 internethering

Hello,

I've just tried to setup an imap backend and i'm getting same error

{
  "reqId": "qsflc4LvA9BxtalY80BF",
  "level": 3,
  "time": "2024-05-13T08:27:55+00:00",
  "remoteAddr": "10.118.119.1",
  "user": "--",
  "app": "user_external",
  "method": "POST",
  "url": "/login",
  "message": "ERROR: Could not connect to imap server via curl: Operation timed out after 10001 milliseconds with 0 bytes received",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0",
  "version": "28.0.5.1",
  "data": {
    "app": "user_external"
  }
}

I've configured the IMAP backend to use the same server used for sending notifications and invitations. I've also verified that I can access the server from the machine where the IMAP backend is running (e.g., using netcat).

I'm using Docker NextCloud Community version 28.0.5

Can you please advise on further troubleshooting steps to resolve the connection timeout issue?

granjerox avatar May 13 '24 09:05 granjerox