pop3 proxy
Istvan Szukacs
leccine at gmail.com
Wed Sep 3 17:51:40 MSD 2008
Hi!
Thank you.
This is the php code:
<?php
$username=$_SERVER["HTTP_AUTH_USER"];
$userpass=$_SERVER["HTTP_AUTH_PASS"];
$protocol=$_SERVER["HTTP_AUTH_PROTOCOL"];
$backend_port=110;
$server_ip="193.252.118.133";
pass($server_ip, $backend_port);
function pass($server,$port){
header("Auth-Status: OK");
header("Auth-Server: $server");
header("Auth-Port: $port");
exit;
}
?>
Regards,
Istvan
Maxim Dounin wrote:
> Hello!
>
> On Wed, Sep 03, 2008 at 12:45:36PM +0100, Istvan Szukacs wrote:
>
>> Thank you!
>>
>> Is it possible to use a local file wo/ http server?
>>
>> /blabla/auth.php
>
> No, only http is supported.
>
>> Or what is the lightweight solution?
>
> You may use the same nginx instance to work with http for this. This
> also allows load-balancing and so on.
>
> E.g. if you want to use php with fastcgi for this, try something like:
>
> mail {
> auth_http http://localhost:8080/auth.php
> ...
> }
>
> http {
> server {
> listen 8080;
> fastcgi_pass ...;
> ...
> }
> }
>
> And then run appropriate php fastcgi application as you usually do for
> normal php scripts under nginx.
>
> Of course for really simple cases you may implement your auth server
> in embedded perl or even with rewrite module. :) But this isn't an
> option in real life since normally you need to do some database
> lookups and therefore need some context where you may use blocking calls.
>
> Maxim Dounin
>
>>
>> Regards,
>> Istvan
>>
>> Maxim Dounin wrote:
>>> Hello!
>>>
>>> On Wed, Sep 03, 2008 at 12:06:08PM +0100, Istvan Szukacs wrote:
>>>
>>>> I am preparing a pop3 proxy with nginx and wondering if somebody could
>>>> help...
>>>>
>>>> I have N hosts behind one firewall and I would like to reach the
>>>> external pop3 server through this proxy.
>>>>
>>>> pop3 {
>>>>
>>>> pop3_capabilities
>>>> <http://wiki.codemongers.com/NginxMailCoreModule#pop3_capabilities>
>>>> "TOP" "USER";
>>>>
>>>>
>>>> server <http://wiki.codemongers.com/NginxHttpCoreModule#server> {
>>>> listen
>>>> <http://wiki.codemongers.com/NginxHttpCoreModule#listen> 110;
>>>> protocol
>>>> <http://wiki.codemongers.com/NginxMailCoreModule#protocol> pop3;
>>>> proxy
>>>> <http://wiki.codemongers.com/NginxMailProxyModule#proxy> on;
>>>> }
>>>>
>>>> }
>>>>
>>>>
>>>> Where and how should i define the real pop3 server?
>>>
>>> Real pop3 server ip address must be returned by your auth_http script
>>> in Auth-Server header.
>>>
>>> See http://wiki.codemongers.com/NginxMailCoreModule#auth and
>>> http://wiki.codemongers.com/NginxMailAuthModule for details.
>>>
>>> Maxim Dounin
>>>
>>
>>
>
More information about the nginx
mailing list