Solved IMAP Issue : Warning: imap_open(): Couldn't open stream
-
Hello,
I'm trying to configure Uvdesk on my website hosted at O2Switch.
The application seems to be correctly installed and is running well (admin management feature at least).I'm struggling with email configuration using IMAP setting.
Whatever to option I choose (Gmail or IMAP), this error message is raised each time I try to refresh the mailbox using this PHP command :php bin/console uvdesk:refresh-mailbox xxx@xxx.com
Here's below error message raised (after different setting for host field)
Using Gmail
WARNING [php] Warning: imap_open(): Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX ["exception" => ErrorException { …}]Using IMAP
WARNING [php] Warning: imap_open(): Couldn't open stream mail.xxxx.com:993 "exception" => ErrorException { …}]
WARNING [php] Warning: imap_open(): Couldn't open stream mail.xxxx.com:145 "exception" => ErrorException { …}]
WARNING [php] Warning: imap_open(): Couldn't open stream {mail.xxxx.com:993} "exception" => ErrorException { …}]I hope one of you will have an idea to help me undrestand what is going wrong.
(Attached a screenshot of uvdesk.yaml conf.)
-
Hi,
I found a solution to fetch the mailbox. The host field was changed withthis new string :
{mail.xxx.com:993/notls}INBOX
My question is, even i use the secured 993 port, is this connection well secured ? I'm not very confident with the "notls" mention.
Thank you,
Christophe.
-
Hi @Christophe, I think port 993 is secure
-
Unfortunately, I got it wrong: {mail.xxx.com:993/notls}INBOX is not working (probably a clear cache issue makes me think it was working but it is not.)
Need to go back with unsecured port to make it working again : {mail.xxx.com:143/notls}INBOX
This still not working with IMAP/SSL conectivity.
Any idea ?
(It's works fine with outgoing message, using a secured SMTP 465 port ...)
-
@Christophe I think you cannot use a secure port 993 without TLS/SSL or will be an insecure port.
I do not suggest to use email that doesn't support secure connection as you will have security issues.Port 465 should be also secure, I don't think can work without TLS/SSL
-
You're totally right. I'd really like to configure it as a secure way but I can't find the exact string to use for Host field with SSL connectivity :
{mail.xxx.com:993/ssl}INBOX seems to not working.
Anyway, thank you for your support.
-
@Christophe Let me check my istall.
You can try {domain.ext:993/imap/ssl}INBOX -
I tried with the same structure but without success.
I need to find a way to put the refresh php query on a debug mode. Maybe the issue will be more easy to understand.
-
@Christophe I'M using this settings and works, if this doesn't works maybe you can have a mail server issue.
Don't know sorry. -
Once again, thank you Marco for your support.
I found a valid host string to fetch the mailbox. Thanks to an extra string (/novalidate-cert) the connection is up and messages are well fetched. I'm not an expert but it seems to me that is it a secure way to access the mailbox.
{mail.xxxx.com:993/imap/ssl/novalidate-cert}INBOX
-
@Christophe maybe your certificate is not trusted and this solve the issue. Your connection is now secure seems by a self-signed certificate that is less secure respect to have a valid certificate but better that not having an SSL/TLS connection.
In my case I don't need this as I use let's encrypt certificate who is recognized.
I'm happy to read you resolved.
Maybe you can contact the control panel or the software that manage the email and suggest to support a valid certificate recognized so you don't need to bypass the certificate validation. -
Good point!
I also installed a Let's encrypt certificate, but before installing UVdesk on my website.
I probably need to renew it. I'll do it and see if that fixes this problem. -
@Christophe umh I think email certificate is managed by your control panel. Don't now but if your certificate is expired maybe you have issue, if still be valid should be not a problem if you installed after the certificate release the uvdesk