Reverse proxy SMTP - How distinguish MUA and MTA


Still building a nginx reverse proxy for my mail servers. Thanks to the
community, I now have a secure connection between nginx and my backend

POP and IMAP are working well, from a MUA to my server.

I’m wondering how nginx can manage SMTP coonnections as it is used by
MUA and MTA.

A MUA must authenticate before sending mails; and my http_auth backend
able to authenticate users. More precisely, the authentication backend
answers a server (auth-server / auth-port) depending on the domain of
destination email address.

Now I guess I have to accept incoming emails without authentication if
client is a MTA, but I don’t find a obvious way to distingish a MUA and
MTA and let mu auth backend behave depending on that.

How to achieve that ?

Posted at Nginx Forum:,259384,259384#msg-259384

I’m wondering how nginx can manage SMTP coonnections as it is used by both

How to achieve that ?

MUA = Port 587 + 465
MTA = Port 25

Maybe use something like Haraka for SMTP?
It’s supposed to be for SMTP-servers what NGINX is for Webservers :wink:


Hi Rainer,

Thank you for this quick answer.

So my idea to declare a server for port 25 and an other for ports 465
587 is probably good.

You pitch about Haraka lead me to investigate about it. Maybe it will
my need to route emails as I need to do.

Posted at Nginx Forum:,259384,259388#msg-259388

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs