views:

114

answers:

2

Hey guys

I am trying to use imap_open() with different linux interfaces but I can't find a possible solution. Nginx seems to have a module (http://wiki.nginx.org/NginxMailCoreModule) for mail servers but I am on Apache + PHP.

cURL has something similar: curl_setopt($ch, CURLOPT_INTERFACE, "eth0:1") but can't find anything for PHP imap.

Any help would be appreciated, thanks a lot

A: 

I don't think you'll be able to do this. It sounds like you're trying to set the source IP address of the IMAP connection. While the application making the IMAP client connection could do this, there would almost never be a need to, and a couple of good reasons not to.

furinkan
A: 

The only way I can think of is to proxy all traffic coming through the php command to a different network interface. All other ways would require modifying the source code because PHP's built-in IMAP library does not support this feature.

If you cURL's IMAP support isn't too limited for your purposes, you could also try that.