imap_open(): Couldn't open stream (imap ssl) - php

I'm trying to read emails from imap mail with the php library ddeboer/imap .
I've created a subdomain like this: abm.mydomain.be . The IMAP extension wasn't installed so I asked the server administrator to install it. The function imap_open now exists. But now I'm getting the following error:
AuthenticationFailedException in Server.php line 76:
Authentication failed for user abm#mydomain.be with error imap_open(): Couldn't open stream {mail.mydomain.be:993/imap/ssl/validate-cert}
The user and passwords are correctly (100% sure of that). When I check phpinfo I see the following with imap:
Does anyone knows what I'm doing wrong?

Related

unable to connect to hostgator using imap library in codeingiter

I tried to get emails from gmail server using imap library
$this->conn = imap_open("{".$this->server.":993/imap/ssl}INBOX",$this->user,$this->pass);
I got error like:
Message: imap_open(): Couldn't open stream {mail.server.com:993/ssl}
It was start working after I unchecked the less secure apps option from my gmail account and then got emails.
but when i used to get emails from hostgator server i got same error
Message: imap_open(): Couldn't open stream {mail.server.com:993/ssl}
Message: Unknown: Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentication failed. (errflg=2)
Message: Unknown: Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed. (errflg=1)
Like gmail server is their any option that i should check or uncheck in hostgator server. or any other method I should used?

imap open gives error for custom email laravel

I am trying to connect custom email through imap but receiving error imap_open(): Couldn't open stream {domain.com:993/imap/ssl}. TLS/SSL failure for domain.com:. Can please let me know what is wrong here.

PHP imap_open(): Couldn't open stream to gmail

I'm getting this messages when I tried to use php-imap to retrieve emails from server using IMAP protocol. I started with gmail accounts. But when I tried to connect using imap_open() I get the following messages:
Warning: imap_open(): Couldn't open stream {imap.gmail.com/imap/ssl:993}INBOX in \path\to\file\imap.php on line 6
or
Warning: imap_open(): Couldn't open stream {imap.gmail.com/imap/ssl/novalidate-cert:993}INBOX in \path\to\file\imap.php on line 6
depending if I use or not novalidate-cert
I found some related question, but not the solution
imap_open(): Couldn't open stream
Getting Error like imap_open(): Couldn't open stream in server
Connecting to Gmail IMAP PHP "Couldn't open stream"
Is it possible connect to email using the imap php extension?
If, Yes. How can I solved this message?
If, No. Which alternative for received email using PHP could be possible?
Try imap.gmail.com:993/imap/ssl. Port number comes after the domain name and befor the URI path.

PEAR/POP3 connects to mailserver, php-imap doesn't

We have a php script to handle bounce mails. Now I have to take care of switching from the PEAR NET/POP3 library to the native-ish php-imap library.
The mailserver listens on a remote server on port 110 without ssl (obviously POP3).
However I am unable to open a connection to that server using the php-imap library using the following code:
imap_open("{example.com:110/pop3/notls}INBOX", $username, $password);
This results in the following errors:
Warning: imap_open(): Couldn't open stream {example.com:110/pop3/notls}INBOX in C:\xampp\htdocs\bounce-processing\info.php on line 1
Notice: Unknown: POP3 connection broken in response (errflg=2) in Unknown on line 0
The following PEAR POP3 implementation still works:
require("Net/POP3.php");
$pop3 = new Net_POP3();
$pop3->connect('example.com', 110)
$pop3->login($username, $password);
What I already tried:
imap_open("{IP-ADDRESS:110/pop3/notls}INBOX", $username, $password);
imap_open("{IP-ADDRESS:110/pop3/notls/user=$username}INBOX", $username, $password);
NOTE: I also tested this on different setups (CentOS / Apache 2.2, Ubuntu 14.04 / nginx, PHP 5.4, PHP 5.5, PHP 5.6, no different outcome.
What can I do? Debugging did not really help me - and that the pear class works freaks me out.
Thanks in advance!
EDIT: php binary is compiled with imap / ssl and the php-imap extension is enabled in the php.ini. If you know another future-proof way to make php talk to a pop3 mailserver, let me know. We don't want to use frameworks such as phpmailer etc.
EDIT2: telnet login works with a success rate of 40%. I was able to successfully log in 4 out of 10 times with correct credentials.
Output of the CAPA command:
CAPA
+OK Here's what I can do:
STLS
TOP
USER
LOGIN-DELAY 10
PIPELINING
UIDL
IMPLEMENTATION Courier Mail Server
.
I don't know if thats important, but the mailserver is in fact hosted by a dedicated server housing and hosting company.
EDIT3: Trying to connect via
{IP_ADDRESS:110/pop3}
returns the following errors:
Warning: imap_open(): Couldn't open stream {IP_ADDRESS:110/pop3} in C:\xampp\htdocs\bounce-processing\index.php on line 12
Notice: Unknown: Certificate failure for IP_ADDRESS: Server name does not match certificate.
Appending the flag novalidate-cert leads to a timeout.

Erro imap roundcube

IMAP Error: OpenSSL not available in C:\wamp\www\roundcubemail-1.0.3\program\lib\Roundcube\rcube_imap.php on line 129 (POST /roundcubemail-1.0.3/?_task=login?_task=login&_action=login)
IMAP Error: Login failed for leandrogabrielbustamante#gmail.com from 127.0.0.1. Empty startup greeting (imap.gmail.com:993) in C:\wamp\www\roundcubemail-1.0.3\program\lib\Roundcube\rcube_imap.php on line 184 (POST /roundcubemail-1.0.3/?_task=login?_task=login&_action=login)
I try to login from roundcube with gmail account but I see this error in logs / errors. Please if someone would help me.
Check that in your php.ini (usually somewhere around /etc/php/) the extension=openssl.so is in use.

Categories