Welcome! Log In Create A New Profile

Advanced

Mail proxy the destination server by ssl (Postfix)

February 13, 2018 02:39AM
Hi everyone, 
I’m trying to mail-proxy by ssl connection from the nginx server to the postfix server.
Please let me ask some question.

SMTPS(465)->| nginx |--SMTPS(465)->| Postfix |

Question1:
I found this issue. The mail module cannot proxy to the destination server by ssl, right?
https://forum.nginx.org/read.php?2,232147,232466#msg-232466


Question2:
I tried the another way to use the stream server, but I could not proxy
(The connection timeout is occurred.)

How can i fix it?

SMTPS(465)->| mail -> upstream(20465)| --SMTPS(465)->| Postfix |

<nginx.conf>
load_module "modules/ngx_stream_module.so";

worker_processes auto;
error_log /var/log/nginx/error.log warn;

events {
worker_connections 1024;
}
stream {
upstream smtps_server {
server postfix_server:465;
}
server {
listen 20465;
proxy_pass smtps_server;
proxy_ssl on;

proxy_ssl_certificate /etc/nginx/ssl/server.crt;
proxy_ssl_certificate_key /etc/nginx/ssl/server.key;
error_log /var/log/nginx/mail-tcp-proxy.log info;
}
}

mail {
auth_http localhost:80/auth/smtp;
proxy_pass_error_message on;
proxy on;
smtp_auth login plain;
xclient on;
server_name nginx_server;

server {
listen 25;
protocol smtp;
}
server {
listen 465;
protocol smtp;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
}
}


Thank you for your time.
Azusa Taroura
Subject Author Posted

Mail proxy the destination server by ssl (Postfix)

Azusa Taroura February 13, 2018 02:39AM

Re: Mail proxy the destination server by ssl (Postfix)

Maxim Dounin February 13, 2018 07:44AM

Re: Mail proxy the destination server by ssl (Postfix)

Azusa Taroura February 20, 2018 02:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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