Welcome! Log In Create A New Profile

Advanced

Knowing the server port inside Perl code

Ondrej Jombik
May 01, 2018 02:48AM
When using mail module for SMTP and doing auth using Perl code, it might
be handy to know entry port number. For example 25/TCP, 465/TCP or
587/TCP; those are the most used ones.

I thought this would be somewhere among provided headers:

$request->header_in('Auth-Method');
$request->header_in('Auth-Protocol');
$request->header_in('Auth-User');
$request->header_in('Auth-Pass');
$request->header_in('Auth-Salt');
$request->header_in('Client-IP');
$request->header_in('Client-Host');
[... ...]

However there is nothing like 'Auth-Port', or 'Client-Port' or
'Server-Port' or any port.

'Auth-Protocol' is no help, because we have same protocol running on
multiple ports; typically 25/TCP is the same as 587/TCP when sending
e-mails with auth.

So I tried to help myself:

proxy on;
auth_http_header Auth-Port $server_port;
auth_http 127.0.0.1:80/auth;
proxy_pass_error_message on;

- or -

auth_http_header Auth-Port $proxy_port;

But none of those worked.

How I can know entry port number inside Perl code?

--
Ondrej JOMBIK
Platon Technologies s.r.o., Hlavna 3, Sala SK-92701
+421222111321 - info@platon.net - http://platon.net

Read our latest blog:
https://blog.platon.sk/icann-sknic-tld-problemy/

My current location: Phoenix, Arizona
My current timezone: -0700 GMT (MST)
(updated automatically)

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

Knowing the server port inside Perl code

Ondrej Jombik May 01, 2018 02:48AM

Re: Knowing the server port inside Perl code

Maxim Dounin May 02, 2018 07:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 315
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready