Welcome! Log In Create A New Profile

Advanced

Dynamically resolving smtp upstream hostnames

kay
June 18, 2021 11:29AM
I'm using a new "proxy_smtp_auth on;" option in my mail proxy server inside k8s cluster, therefore I just need to proxy_pass smtp requests to the backend. Since the backend must be set using the "auth_http" directive, I use the code below and provide the hostname instead of IP address:

server {
listen 127.0.0.1:8025;
server_name _;
access_log off;

location / {
add_header "Auth-Server" "smtp-hostname.local";
add_header "Auth-Port" "25";
return 200;
}
}

Unfortunately nginx even with the resolver enabled in mail section doesn't resolve the hostname:

auth http server 127.0.0.1:8025 sent invalid server address:"smtp-hostname.local" while in http auth state

It is also not clear how to resolve the "smtp-hostname.local" hostname to an IP address in the "127.0.0.1:8025" listener. Using LUA is an overkill. Any suggestions on how to dynamically resolve the smtp upstream hostname?
Subject Author Posted

Dynamically resolving smtp upstream hostnames

kay June 18, 2021 11:29AM

Re: Dynamically resolving smtp upstream hostnames

kay June 28, 2021 10:34AM

Re: Dynamically resolving smtp upstream hostnames

Maxim Dounin June 28, 2021 11:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 245
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