Welcome! Log In Create A New Profile

Advanced

Re: how to get remote_addr in ngix for POP/IMAP with perl module

Maxim Dounin
October 28, 2010 11:22AM
Hello!

On Thu, Oct 28, 2010 at 10:59:21AM -0400, moorthi wrote:

> i am running ngnix with perl module for IMAP/POP, but i am not getting
> the source remote address from where user is authenticating.

[...]

> [b]my mailauth.pm handler function on nginx server 192.168.1.1:[/b]
> sub handler {
> my $r = shift;
> $r->header_out("Auth-Status", "OK");
> $r->header_out("Auth-Server", '192.168.1.2');
> $r->header_out("Auth-Port", '143');
> $r->send_http_header("text/html");
> warn 'H: ',$r->remote_addr;
> return OK;
> }
>
> [b]from 192.168.1.3[/b]
> telnet 192.168.1.1 143
> . login user1 pass1
> . OK [CAPABILITY IMAP4 IMAP4rev1 logged in
>
> [b]on 192.168.1.1 tail -f /var/log/nginx/error_log[/b]
> H: [b]127.0.0.1[/b] at /usr/share/nginx/perl/lib/mailauth.pm line 59.
>
> actually i have to get 192.168.1.3
> how to get this remote_addr can u plz help me.

Connection to auth_http server is obviously from nginx, not
client. Client's ip address as seen on nginx mail proxy is
available in Client-IP header.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Is there a problem with my nginx.conf?

sastro August 25, 2010 02:06PM

Re: Is there a problem with my nginx.conf?

Igor Sysoev August 25, 2010 02:26PM

how to get remote_addr in ngix for POP/IMAP with perl module

moorthi October 28, 2010 10:59AM

Re: how to get remote_addr in ngix for POP/IMAP with perl module

moorthi October 29, 2010 03:57AM

telnet imap not showing existing emails thru nginx

moorthi November 01, 2010 04:21AM

Re: telnet imap not showing existing emails thru nginx

moorthi November 01, 2010 05:03AM

Re: how to get remote_addr in ngix for POP/IMAP with perl module

moorthi October 09, 2013 07:08AM

Re: how to get remote_addr in ngix for POP/IMAP with perl module

moorthi October 09, 2013 07:17AM

Re: how to get remote_addr in ngix for POP/IMAP with perl module

Maxim Dounin October 28, 2010 11:22AM

Re: telnet imap not showing existing emails thru nginx

Maxim Dounin November 01, 2010 04:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 156
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready