I'm getting an error:
Warning: imap_open() [function.imap-open]: Couldn't open stream {pop3.live.com:995/pop3/ssl/novalidate-cert}INBOX in /home/.../imap.php on line 3
when using code:
$mbox = imap_open('{pop3.live.com:995/pop3/ssl/novalidate-cert}INBOX', '<user>', '<pass>');
Your URL has pop3 for a sub-domain. Are you sure that IMAP is available (ports 143 or 993 open)?
Doing a quick search, it looks like imap has to be enabled on your live.com account. Are you able to IMAP to the server using a standard mail client, like Thunderbird?
Also, you are pointing to pop3.live.com on port 995, which is a POP3 port, not an IMAP port.
In my case it was {domain:110/pop3/novalidate-cert}INBOX that helped me in fixing both the CLOSED IMAP connection broken (server response) and Certificate failure for domain.
Confirm your ports and also whether you have ssl enabled using
openssl s_client -crlf -connect your-domain-name:port-number
Related
I use the PHP function imap_open to connect to a localhost dovecot server. It works most of the time, but sometimes I have warning:
PHP Warning: imap_open(): Couldn't open stream
{imap.fluoo.com/imap:993/ssl/novalidate-cert}INBOX Can not
authenticate to IMAP server: [CLOSED] IMAP connection broken
(authenticate)
When this occur I have in mail log:
Sep 3 10:38:01 bipbip dovecot: imap(robot.info#XXXXXXX.com)<3325276><ovIENBPLAsV/AAAB>: Connection closed (No commands sent) in=0 out=394 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
I haven't this error for distant connexion with Thunderbird or Outlook, only for PHP in localhost.
I have read that the issue is due to SSL but I don't want to disable it.
I use PHP 7.4.22 and dovecot 2.3.7.2.
If you can help me because I want to try to avoid use # operator to delete warning...
I am working in codeigniter framework using imap library. I want to get all mails from my mail server into my web app.
My code is working fine when i am using
imap_open("{imap.gmail.com:993/imap/ssl}INBOX", my_email, my_password);
but whenever I tried to get access of my hostgator mail server I got these type of errors.
1: imap_open(): Couldn't open stream {mail.mydomain.com:993/imap/ssl}INBOX
2: Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed. (errflg=1).
3: Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentication failed. (errflg=2)
According the HostGator Documentation you should provide (for secured imap):
A username, your full email address
Your password
Your full server name
Port: 993
SSL: SSL/TLS
You should end up with something like
imap_open("{full.servername.com:993/imap/ssl/tls}", "my.email#servername.com","pwd");
You could also try the normal incoming mail settings which requires
A username, your full email address
Your password
Your full server name
Port: 143
SSL: none
Resulting in:
imap_open("{full.servername.com:143}", "my.email#servername.com","pwd");
I'm trying to get emails through a PHP script:
$mbox = imap_open("{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX", "username#gmail.com", "password");
But I'm constantly getting this error:
Warning: imap_open(): Couldn't open stream {imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX
IMap is enabled on my Google Account.
From the server, I tried nmap -p 993 imap.gmail.com and it return that there is imap service under this address.
regards
In my case, this error is caused by the outbound proxy blocking access to port 993.
I try to get the Gmail inbox emails using Eden mail PHP from my localhost (XAMPP Apache server). But it throws a fatal error:
Fatal error: Uncaught Eden\Mail\Exception: Problem connecting to
ssl://imap.gmail.com:993. Check server, port or ssl settings for your
email server.
in C:\xampp\htdocs\edenMail\vendor\eden\mail\src\Imap.php:357
Stack trace:
0 C:\xampp\htdocs\edenMail\vendor\eden\mail\src\Imap.php(170): Eden\Core\Exception::i()
1 C:\xampp\htdocs\edenMail\vendor\eden\mail\src\Imap.php(357): Eden\Mail\Imap->connect()
2 C:\xampp\htdocs\edenMail\index.php(36): Eden\Mail\Imap->getMailboxes()
3 {main}
thrown in C:\xampp\htdocs\edenMail\vendor\eden\mail\src\Imap.php on line 357
I have used below code in Eden mail's index.php file with my own credentials.
$imap = eden('mail')->imap(
'imap.gmail.com',
'myEmailId',
'myPassword',
993,
true);
In addition to that, I have enabled IMAP/POP3 and turned on less secure apps as well in my Gmail settings.
I have encountered this error only when I try to connect from my localhost (Windows-Xampp-Apache server). But there is no error if test code in my web server working in Linux environment.
Could anyone please help me to connect the google imap.gmail.com to retrieve inbox emails?
I have followed the instructions given in the below link and got the issue resolved. I am sharing it as if may help anyone with the same issue.
https://www.hesk.com/knowledgebase/?article=72
Having problems getting Gmail to work with HESK? Try these settings.
» Email sending
To send emails using Gmail server enter these details:
SMTP Host: smtp.gmail.com
SMTP Port: 587
SSL Protocol: OFF
TLS Protocol: ON
SMTP Username: (your Gmail username)
SMTP Password: (your Gmail password)
Also make sure your "From email address" in HESK settings is set to your Gmail email address!
Still no luck? Check with your host if they have port 587 blocked in firewall.
» POP3 fetching
To fetch mail from Gmail server enter these details:
POP3 Host: pop.gmail.com
POP3 Port: 995
TLS Protocol: ON
POP3 Username: (your Gmail username)
POP3 Password: (your Gmail password)
Important: make 100% sure that "POP3 download" in your Gmail settings
is set to "Enable POP for mail that arrives from now on". If not,
Gmail will send all existing (even read) messages to HESK when it
first connects.
» IMAP fetching
To fetch mail using IMAP from Gmail server enter these details:
POP3 Host: imap.gmail.com
POP3 Port: 993
Encryption: SSL
POP3 Username: (your Gmail username)
POP3 Password: (your Gmail password)
» Error messages
Connection timed out
Required ports are probably blocked on your server's firewall. Ask your host to configure the firewall to allow TCP connections on ports 587, 995 and/or 993.
Some hosting companies will not do that due to their policies. In that case you will need to, in order to integrate Gmail with HESK, find another host or try the HESK cloud.
Permission denied
Try logging with your google account here to unlock it for application access.
Click the "Continue" button to Allow access to your Google account.
Password error: [AUTH] Username and password not accepted. Too many
login failures
Your username and/or password is not correct, double-check them ad remember passwords are CaSe SeNSiTiVe!
Password error: [AUTH] Web login required
See this article
Error: 0 could not connect to the host "pop.gmail.com"
This could mean that:
required ports are blocked on your server's firewall. Ask your host to unblock TCP connections on ports 587, 995 and/or 993
- OR -
SSL certificate verification fails on your server. Try this:
download this file
save it somewhere to your server, for example to C:\wamp\ssl\cacert.pem
open your php.ini file
find the line
;openssl.cafile=
and change it to the location of the cacert.pem file while also removing the starting ;
openssl.cafile=C:\wamp\ssl\cacert.pem
save and restart the server
test again
I am having some issues with imap_open.
This is the error I am getting:
Message: imap_open(): Couldn't open stream
{imap-mail.outlook.com:993/imap/ssl/novalidate-cert}INBOX
No matter if its imap using ssl on port 993 or pop ssl on port 995, I am getting the same error.
Message:
Unknown: Can't open mailbox
{imap-mail.outlook.com:993/imap/ssl/novalidate-cert}INBOX: invalid
remote specification (errflg=2)
I have the following setup:
Mac OSX Yosemite
Mamp Pro running PHP 5.6.10
Here is what I've done to troubleshoot:
I have apple mail setup to check my gmail account using imap ssl on port 993. I will assume if apple mail can retrieve mail, the port is open.
I went to Security and Privacy and did a PORT SCAN... 993 and 995 were not open... strange.
I do not have Mac Firewall enabled.
When using non ssl, on port 110 pop, this appears to be working fine.
Can anyone assist to see what may be the cause.
Check phpinfo() to see if php is complied --with-imap-ssl
http://www.bartvanasselt.nl/mamp-pro-using-imap-with-ssl/
Also can try tunneling:
Workaround for PHP IMAP functions? Trying to work with incoming email on localhost using XAMPP