Inbound Email configuration / no connecting to the server

Hi all,

We had have upgrade our Sugar instance from Version 8 to Version 9.0.5.
All requirements are set. SugarCRM is running on a Windows server, IIS Web server, Database is Oracle 12c, PHP 7.1.23

Since the upgrade the handshake to the email-server can not established anymore. The error comes from a CRM Plugin called Laminas-mail, which was brought new in one version between 9.0 and 9.0.5.

Connection (via cURL) from CRM Webserver can be established. Password, User name are valid, also Server name and port.

Sugar Support can not help and suggested to ask the dev club.

I am a bit lost right now. Is there someone which faced the same or similar issues?

Any help would very much appreciated.

Thank you!


PHP Fatal error: Uncaught ErrorException: fsockopen(): unable to connect to <SERVER>:993 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
) in D:\www\crm\vendor\laminas\laminas-mail\src\Protocol\Imap.php:91


Next Laminas\Mail\Protocol\Exception\RuntimeException: cannot connect to host ; error = fsockopen(): unable to connect to ssl:// (Unknown error) (errno = 0 ) in D:\www\crm\vendor\laminas\laminas-mail\src\Protocol\Imap.php:94
Stack trace:
#0 D:\www\crm\vendor\laminas\laminas-mail\src\Protocol\Imap.php(45): Laminas\Mail\Protocol\Imap->connect('ssl://', 993, 'ssl')
#1 D:\www\crm\modules\Mailer\ImapMailer.php(85): Laminas\Mail\Protocol\Imap->__construct('imap4.comm.........', 993, 'ssl')
#2 D:\www\crm\modules\Mailer\ImapMailer.php(67): ImapMailer->createConnection()
#3 D:\www\crm\modules\InboundEmail\InboundEmail.php(5495): ImapMailer->__construct(Object(Mailbox), 'R1\\pre-case-sup...', 'Passwort1234.', '')
#4 D:\www\crm\modules\InboundEmail\InboundEmail.php(2483): InboundEmail->getImapMailer(Object(Mailbox))
#5 D:\www\crm\modules\InboundEmail\Save.php(69): InboundEmail->preConnectMailServer(true, '<USERNAME>', '<PASS>.', Object(RemoteSystemName), '993', 'imap', 'INBOX', '')
#6 D:\www\crm\include\MVC\View\SugarView.php(550): require_once('D:\\www\\crm\\modu...')
#7 D:\www\crm\include\MVC\View\views\view.classic.php(43): SugarView->includeClassicFile('modules/Inbound...')
#8 D:\www\crm\include\MVC\View\SugarView.php(152): ViewClassic->display(Array)
#9 D:\www\crm\include\MVC\Controller\SugarController.php(360): SugarView->process(Array)
#10 D:\www\crm\include\MVC\Controller\SugarController.php(308): SugarController->processView()
#11 D:\www\crm\include\MVC\SugarApplication.php(199): SugarController->execute()
#12 D:\www\crm\index.php(27): SugarApplication->execute()
#13 {main}

  • We recently had a similar issue (but not exact) with an email plugin and not connecting when credentials were correct.  Ours was related to the certificate at Sugar that was updated 2/21 but we were not made aware so as we have a slightly older OS, this issue would not let us use the plugin.  It has since been resolved when we aligned the updated certificate.  Just a thought.

  • This isn't an answer to your question but why not use this on your server instead and then have Sugar send to localhost?

  • Hi David, Thank you for your response. Maybe a stupid question. From what kind of a "certificate at Sugar" are you talking? We're working on a On-premise instance. Our Windows server is on the required version.


  • Hello Rene, 

    I talk to my fellow sysadmin teammates, they suggest checking 3 bullets:
    - to confirm that the other certificate then Self Signed Certificate used for IMAP SSL 993 (we had an experience that Sugar doesn't work with conditionally free email server if SSL certificate is self signed)
    - to check whether it is possible to connect to the service with console from the Sugar host, as it is described here:
    - look into the mailing server log

    They give a high probability that these 3 steps should help to troubleshoot the core issue since they point on    
    "cannot connect to host ; error = fsockopen(): unable to connect to" as the main problem.
    You might get the error description from the console instead of  (Unknown error) (errno = 0 ) 

    Best Regards,
    Dmytro Chupylka
    We make work in Sugar CRM system faster, more convenient and efficient

  • Hi David,

    Thank you very much for the hint with the certificate. It pointed us at the end to the php.ini.

    Since the patch to 9.0.5 a feature has taken place. There were changes in the "Email and connector security"

    With this Version this "Laminas" Plugin has been new in the package. On our side a change in the php.ini was needed. This was not mentioned all all.

    Before 9.0.5, we defined the path for the certificate file only for "curl.cainfo". Since version 9.0.5 it is also needed to define the certificate file for the "openssl.cafile" parameter.
    This fixed it, an all works fine now.

  • Hi Dmytro,

    Thank you for taking the time to answer. Meanwhile we found a solution witch has to do the the certificate file and the php.ini.

    Please see my answer above.

    Best regards