PHP / POP / imap_open() problem

tetranz

Perch
Hi all

I'm trying to use the imap / pop functions in php to read a pop mailbox. Here's my code with the obvious changed.

PHP:
$host = 'mail.mydomain.com';
$name = '[email protected]';
$pwd = 'mypw';

$mailbox = '{' . $host . ':110/pop3/notls}INBOX';
$mbox=imap_open ($mailbox, $name, $pwd);
That always crashes with "Couldn't open stream".

print_r(imap_errors()) returns "Array ( [0] => Can't login to this server )".

I assume other people have this working. Is there something wrong with my mailbox string? What has worked for others?

$mailbox is set to {mail.mydomain.com:110/pop3/notls}INBOX

I'm familiar with pop and can successfully login to the mailbox using telnet to port 110 using those credentials.

If I change the host, name and password to a mailbox outside of Jodo, eg at my ISP, then it works successfully.

I'm actually doing this as a test while trying to fix another problem where a PHP script an another host outside Jodo logs in to a Jodo mailbox. That stopped working yesterday with the same error as this test page at Jodo gives. Likewise, that script still works with a non-Jodo mailbox.

I'd appreciate it if anyone has an application with similar code to check to see if it is still working today.

Thanks
Ross
 
Thanks for your efforts Tanmaya and Deepak. I didn't think to try imap :)

Just for the benefit of anyone else, the answer is to use imap instead of pop so replace :110/pop3 with :143/imap. I think those are defaults anyway so they could probably be left out.

Its still a mystery to me as to why pop doesn't work because I'm sure it used to and it still does with non JodoHost mailboxes but ... I've done some testing this morning and the other functions seem to work the same way regardless of whether the connection is pop or imap so this seems to be a perfectly good solution.

Cheers
Ross
 
Ross, this is no mystery, but a Psoft's usual way of doing mistakes. As far as i see it relates to the issue with output of CAPA command during the POP3 session. Psoft closed any updates for Hsphere 2.4.3 branch with package "introducing" this issue and now not ready to fix. It is good that we have a workaround at hand :)143/imap) and seems to be more used than the pop3 equivalent.
 
Back
Top