Forum Moderators: coopster
[webmail.mydomain.com...]
so I guessed that I should use this syntax in my php script:
imap_open("{webmail.mydomain.com:143 INBOX", "username", "password");
But it does not work. I receive this error message:
Warning: imap_open(): Couldn't open stream {webmail.mydomain.com:143}INBOX
Help! I have asked my host about this and from their reply I dont think they even know what IMAP functions are. So, I am really stuck. I have read about opening an IMAP stream and that there are different syntaxes for different software components and scenarios - how can I find out which one is appropriate for my set up, given that asking my host is out?
The webmail is horde webmail. The login url is below
[webmail.mydomain.com...]
I am on a virtual server. So, I have an IP - but it is a shared IP of course. My host provided me with 3 IPs - one for FTP access, one is just my private IP (behind a firewall), the other is a public IP (outside the firewall). I have to give my public IP to DNS.
[php.net...]
including the user comments
I am guessing the connect string is the problem
try this search [google.com] for some more examples
not sure haven't really used the imap functions
I hate horde
-------
Here I have cut and paste some info on the variation in this syntax:
// To connect to an IMAP server running on port 143 on the local
machine use:
$mbox = imap_open("{localhost:143}INBOX", "user_id", "password");
// To connect to a POP3 server on port 110 on the local server, use:
NOTE HERE A POP3 IS USED
$mbox = imap_open ("{localhost:110/pop3}INBOX", "user_id", "password");
// 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");
// To connect to an SSL IMAP or POP3 server with a self-signed
certificate,
// add /ssl/novalidate-cert after the protocol specification:
$mbox = imap_open ("{localhost:995/pop3/ssl/novalidate-cert}",
"user_id", "password");
// To connect to an NNTP server on port 119 on the local server, use:
$nntp = imap_open ("{localhost:119/nntp}comp.test", "", "");
Some IMAP servers have different forms for connection. For example, connection to Microsoft Exchange might require you to use "{mail.yourserver.com:143/imap}Inbox" and also provide the username as "<yourdomain>/<yourusername>".
If you are running your IMAP server using SSL, you may need to use "{mail.yourserver.com:993/ssl/novalidate-cert}INBOX".
from the command-line on your host:
telnet mail.myhost.com 143 If you get something like this, you're OK:
Trying 12.34.56.78...
Connected to mail.myhot.com
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2004 Double Precision, Inc. See COPYING for distribution information.
If you get a timeout, you're either being blocked by a firewall, or you've got the wrong hostname.
The problem, from what I can see, is that generally you're trying to connect to the webmail server -- they probably have their IMAP/mail server on another machine, or hostname.
$imap = imap_open("{localhost:143/notls}INBOX"
it is the /notls that I was missing. Not in the official documentation that this is essential - but it is needed for my system it would seem.