5

I don't really know how to ask this question so I'll just ask it as best I can. Is it possible to use a proxy connection to read mail from a pop3 or imap server using PHP's imap_open?

I would prefer to use imap_open since it's so simple to handle the mail. but, if using imap_open isn't possible, what other solutions are there? Could CURL or fsockopen work? I can't seem to find any example showing a connection to pop3/imap behind a proxy in PHP.

Any advice would be very helpful!

john
  • 1,330
  • 3
  • 20
  • 34
  • Well, depends on the type of proxy: if it is a (transparent) sox proxy then it is just a question of configuration. If you are talking about an internet access where all outgind traffic is blocked except http via a web proxy, then obviously you cannot use phps imap extension, since it does not use http communication. – arkascha Nov 17 '12 at 17:23
  • It's a http squid proxy setup on a local network. It was setup to allow external connections on the local network when traveling. – john Nov 17 '12 at 17:26
  • Ah, you want to access an imap server inside a local network via a proxy, ok. As far as I know there is no real solution to transport the imap protocol via http. Some threads exist in the internet, but nothing appears to offer a real solution. Though I'd say it should be possible to implement that. You would need an implementation on _both_ sides. That way you could wrap the imap stream inside http. nothing speaks against that. But I don't know of a solution out of the box. – arkascha Nov 17 '12 at 17:36
  • You might want to explode options for generic http tunneling. There might be some solutions you could adapt for your purpose. – arkascha Nov 17 '12 at 17:37
  • In Theory, you could use HTTP CONNECT to tunnel it (which is how HTTPS is tunneled), but I doubt it's built into the language. – Max Nov 17 '12 at 19:58

0 Answers0