Port access

Maxim Dounin mdounin at mdounin.ru
Fri Mar 27 14:15:17 MSK 2009


Hello!

On Fri, Mar 27, 2009 at 02:45:33PM +0530, derwyn wrote:

> Hi,
> I've found on the site the code in php to authenticate the users for  
> imap/pop.
> the php app server sees the user and password as
>    HTTP_AUTH_USER
>    HTTP_AUTH_PASS
>    HTTP_AUTH_PROTOCOL
>
> Is it also possible to get the port that the user is connection to ie  
> 110,143 or 993,995 with some HTTP_AUTH_  variable

You may add arbitrary headers via auth_http_header directive.  
E.g.:

mail {
    auth_http  ...

    server {
        listen    110;
        protocol  pop3;

        auth_http_header  X-Auth-Port  110;

        ...
    }

    server {
        listen    995;
        protocol  pop3;

        ssl on;

        auth_http_header  X-Auth-Port  995;
        
        ...
    }
}

Maxim Dounin





More information about the nginx mailing list