Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    z-push - config of imap not working - Invalid remote specification (errflg=2)

    Z-Push when using other backends
    2
    3
    997
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Realshadow
      Realshadow last edited by Realshadow

      Hi community,

      I have the following issue right now and really don’t know what else to do:
      I have 2 virtual machines. One is managing my emails (inboxes & sending) with the IP 192.168.1.153. The imap inbox is managed by dovecot and I have both ports (imap 143 and imaps 993) configured. The server is setup with a self signed certificate.
      My z-push server is running on the IP 192.168.1.156 and the z-push IMAP backend config looks like the following:

      // Defines the server to which we want to connect
      define('IMAP_SERVER', '192.168.1.153');
      
      // connecting to default port (143)
      define('IMAP_PORT', 993);
      
      // best cross-platform compatibility (see http://php.net/imap_open for options)
      //define('IMAP_OPTIONS', '/notls/norsh');
      define('IMAP_OPTIONS', '/novalidate_cert');
      

      I already tried the following options in the last line ‘IMAP_OPTIONS’

      /notls/norsh
      /tls/novalidate_cert
      /tls
      /notls/novalidate_cert
      

      most of the time I am getting the error message

      28/03/2021 16:30:52 [  595] [WARN] [USER] Unknown:0 Unknown: Can't open mailbox {192.168.1.153:993/imap/novalidate_cert}: invalid remote specification (errflg=2) (8)
      
      

      Despite this error it is impossible that the email server (IMAP inbox) setup is wrong. I tested the setup with

      telnet 192.168.1.153 143 
      

      which gives me an error message due to the connection not being established with TLS, which is OK because as soon as I test with

      openssl s_client -connect 192.168.1.153:993 -crlf
      

      and I login with the same credentials that I use with the z-push login window it works just fine. So I cannot be that far off I just can’t figure out for the life of me where the issue lies. I also created a WBXML which contains:

      28/03/2021 16:30:52 [  595] [DEBUG] [USER] cmd='' devType='' devId='' getUser='USER' from='192.168.1.XX' version='2.6.2+0-0' method='GET'
      28/03/2021 16:30:52 [  595] [DEBUG] [USER] Used timezone 'America/Edmonton'
      28/03/2021 16:30:52 [  595] [DEBUG] [USER] Request::ProcessHeaders() ASVersion: 14.1
      28/03/2021 16:30:52 [  595] [DEBUG] [USER] ZPush::CommandNeedsAuthentication(0): true
      28/03/2021 16:30:52 [  595] [WARN] [USER] /usr/share/z-push/backend/imap/imap.php:127 imap_open(): Couldn't open stream {192.168.1.153:993/imap/novalidate_cert} (2)
      28/03/2021 16:30:52 [  595] [ERROR] [USER] BackendIMAP->Logon(): can't connect as user 'USER' on '{192.168.1.153:993/imap/novalidate_cert}': Can't open mailbox {192.168.1.153:993/imap/novalidate_cert}: invalid remote specification
      28/03/2021 16:30:52 [  595] [ INFO] [USER] AuthenticationRequiredException: Access denied. Username or password incorrect - code: 0 - file: /usr/share/z-push/lib/request/requestprocessor.php:69
      28/03/2021 16:30:52 [  595] [ INFO] [USER] User-agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537. (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36'
      28/03/2021 16:30:52 [  595] [FATAL] [USER] Exception: (AuthenticationRequiredException) - Access denied. Username or password incorrect
      28/03/2021 16:30:52 [  595] [DEBUG] [USER] ZPush::PrintZPushLegal()
      28/03/2021 16:30:52 [  595] [DEBUG] [USER] InterProcessData:__construct type: ''
      28/03/2021 16:30:52 [  595] [DEBUG] [USER] TopCollector initialised with IPC provider 'IpcMemcachedProvider' with type '20'
      28/03/2021 16:30:52 [  595] [ INFO] [USER] cmd='' memory='1.56 MiB/2.00 MiB' time='0.01s' devType='' devId='' getUser='USER' from='192.168.1.xx' idle='0s' version='2.6.2+0-0' method='GET' httpcode='401'
      28/03/2021 16:30:52 [  595] [DEBUG] [USER] -------- End
      
      

      The setup works fine if I test with the caldav and carddav backends. Same username and password obviously.

      Does anyone have any idea what the culprit could be? I did assume that when the OPENSSL test works I could get z-push to work easily but obviously was wrong.

      EDIT
      The closest I have gotten to a successful communication between both servers was the following:

      // Defines the server to which we want to connect
      define('IMAP_SERVER', '192.168.1.153');
      
      // connecting to default port (143)
      define('IMAP_PORT', 993);
      
      // best cross-platform compatibility (see http://php.net/imap_open for options)
      define('IMAP_OPTIONS', '/notls/norsh');
      

      With these settings I have at least gotten an entry into the mail logfiles:

      Mar 28 17:17:33 EmailServer dovecot: imap-login: Disconnected (no auth attempts in 60 secs): user=<>, rip=192.168.1.156, lip=192.168.1.153, TLS handshaking: Connection closed, session=<CHdR+KC+DrnAqAGc>
      

      Not that that was a successful communication but at least something happened between both servers.

      Thanks for your help.

      regards
      realshadow

      Manfred 1 Reply Last reply Reply Quote 0
      • Manfred
        Manfred Kopano @Realshadow last edited by

        Hi @realshadow,

        did you try

        define('IMAP_OPTIONS', '/ssl/novalidate-cert');
        

        ?

        Manfred

        Realshadow 1 Reply Last reply Reply Quote 0
        • Realshadow
          Realshadow @Manfred last edited by

          @manfred yes. Unfortunately that didn’t work. I decided to turn all safety and security options off and have unencrypted traffic for now until I can make it work in general but so far I am running in more issues in the backends, this time caldav. see here: Cal Dav Sync error

          1 Reply Last reply Reply Quote 0
          • First post
            Last post