Re: Retrieving pop mail from gmail/ssl



Jerry Stuckle wrote:
bill wrote:
The Natural Philosopher wrote:
bill wrote:
Jerry Stuckle wrote:
bill wrote:
bill wrote:
Álvaro G. Vicario wrote:
bill escribió:
My ISP recently transferred its mail service to google, which leaves me up a creek. I have an application that used to retrieve pop3 using the IMAP package. Gmail uses POP over SSL on port 995.

I changed my statement to:
$in=imap_open("{pop.gmail.com:995/pop3}","my@xxxxxxxxxxxxxxxxx", "mu_password");

but, obviously this is inadequate as $in return bool(false).

I suppose you have to instruct imap_open() to use SSL. This is from example #1 in the PHP manual:

// To connect to an SSL IMAP or POP3 server, add /ssl after the protocol
// specification:
$mbox = imap_open ("{localhost:993/imap/ssl}INBOX", "user_id", "password");

http://es.php.net/imap_open

Thanks for reading the manual for me, but it doesn't work.

After a long time (5 minutes ?) the script terminates with no output.

here is my test script:
<?php
error_reporting(E_ALL);

echo "about to imap_open <br />";

$in=imap_open("{pop.gmail.com:995/pop3/ssl}","info@xxxxxxxxxxxx", "xxxxxxxxx");

echo "about to get headers - <br />";

$msgs=imap_headers($in); // gets the headers from the currently available msgs

echo " <br />about to imap close <br />";
imap_close($in);

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Test/Get Mail</title>
</head>
<body>
Test/Get Mail

</body>
</html>

if I comment out the imap_open statement it runs fine.


The server error log says:
PHP Warning: imap_open(): Couldn't open stream {pop.gmail.com:995/pop3/ssl} in /hsphere/local/home/techservsys/houndsofheaven.com/ContactManagement/testGetMail.php on line 9

Anyone have any suggestions ?

Is there an imap server running on port 995?

this is pop over ssl. And - this is gmail who does things their own way frequently. I have it running just fine from Thunderbird on port 995, but when I telnet in on that port manually I get, "Connection to host lost"

On the other hand, when I telnet to pop.gmail.com on port 23 I get, "Connect Failed"

The normal port for imap
over ssl is 993. Can you telnet into the port (preferably from that server)?

What does the system log show?

I don't think that google is going to let me access their server logs.

bill


Ah. here's a more useful snippet from the manual comments
>>>>
The following works for connecting via POP3 to a gmail server:
imap_open("{pop.gmail.com:995/pop3/ssl/novalidate-cert}INBOX", $username, $password);
<<<<
I cant test, cos have no gmail account.


Well, I tried this and the prior suggestion of using imap.gmail.com:993

no joy.

If anyone wants to try these out, I would be willing to give them access to a google account - write me privately: william-take-out-this@xxxxxxxxxxxxxxxxxxxxxxxx

bill

But you never answered my other question - are you sure you have ssl support in PHP?

it was configured
'--with-openssl=/usr'
'--with-imap=/usr'

and ssl is one of the Registered Stream Socket Transports
'--with-imap-ssl'
.



Relevant Pages

  • Re: sudo without password
    ... If you're setting up an IMAP ... server, you'd just check off or type in "IMAP". ... the firewall would be completely invisible, ... Thus, even without a single port open, you can use ...
    (Ubuntu)
  • Re: outlook express wont connect using ssl
    ... my smtp VS which is on 587 to the same settings as my default server ... the only difference is the port #. ... As soon as the cert has been added, SSL ...
    (microsoft.public.exchange.admin)
  • Re: outlook express wont connect using ssl
    ... my smtp VS which is on 587 to the same settings as my default server ... the only difference is the port #. ... SSL ...
    (microsoft.public.exchange.admin)
  • Re: How to turn on iMAP for the iPhone
    ... Blackberry which we got working with exchange ok ... should this be the public one or the internal one for the server ... Port 25 is for SMTP and has nothing to do with IMAP, ...
    (microsoft.public.exchange.setup)
  • Re: No SSL on fetchmail?
    ... It depends on the port you connect to. ... encrypted via SSL. ... Connect to the server using the specified base ... So, if you want to use fetchmail on an IMAP server without using SSL, ...
    (comp.mail.misc)

Loading