Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Nginx proxy - Hide backend mailserver IP

$
0
0
Hi,

I'm trying to create a proxy with Nginx (1.11.2) in a dedicated VPS to a remote client mail server with a DDNS ip (hmailserver). I have two network interfaces in this VPS and i want to use one just for the mail proxy. Authentication, SMTP, POP3 and IMAP are all working fine.

The first problem is that mail sent from this server is showing it's own IP (point 1 in attached picture). Of course SPF fails (point 2) and mail will end up in spam. The received line appears to be added by gmail.

The second problem is that Nginx is sending mail through the VPS main IP and not the one specified in the listen directive.

The third problem is i cannot pass client ip address to the mail server. I've tried xclient but hmailserver doesn't seem to support it and i get a 451 4.3.2 internal server error when authenticating smtp. Is there another way?

I cannot change the client's mail solution, so i need to overcome this problems. Can this be done in Nginx or i should move on to another solution?

TIA

my mail conf

mail {

server {
server_name remote_server;
listen x.x.x.x:25;
protocol smtp;
smtp_auth none;

proxy on;

xclient off; # hmailserver doesn't seem to support it
resolver 8.8.8.8;

auth_http auth.x.com:80/smtp.php;
}

server {
server_name remote_server;

listen x.x.x.x:110;
protocol pop3;
pop3_auth plain apop cram-md5;

pop3_capabilities "TOP" "USER";

auth_http auth.x.com:80/pop3.php;
}

server {

server_name remote_server;
listen x.x.x.x:143;
protocol imap;

imap_capabilities "IMAP4rev1" "UIDPLUS";

auth_http auth.x.com:80/imap.php;
}

}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>