1

I have implemented a nginx with mail module, and proxy to backend Hmail server. I realized no matter how I disable the auth-methods PLAIN. The nginx is just ignoring it.

How can I force to using smtp_auth login instead? As Hmail server does not support AUTH_PLAIN mechanism.


auth_http  localhost:8080/auth.pl;

 server {
        # not working as always AUTH_PLAIN
        listen    25;
        protocol  smtp;
        smtp_auth login;
#       starttls on;
        timeout 5s;
        proxy on;
        xclient off;
        proxy_smtp_auth on;
    }

1 Answers1

0

In fact, i solved it in a other way, as i would like to use all features with my NGIX and my MAILCOW, i used this way

NGINX.conf

stream { include /etc/nginx/streams/*; }

/etc/nginx/streams/mailcow_proxy.conf

server {
listen [::]:25 ipv6only=off;
listen [::]:143 ipv6only=off;
listen [::]:587 ipv6only=off;
listen [::]:993 ipv6only=off;
proxy_pass 10.11.12.13:$server_port;
proxy_protocol on;
}

Conclusions

Instead of interferencing nginx to do the auth, you just pass anything directly to your Mailserver as it should and usually as you would if it would be connected directly.

You may also use the directly insertion into nginx.conf but i dislike this way.

djdomi
  • 1,377
  • 3
  • 10
  • 19
  • hi @djdomi, But it is only target to 1 mailcow right? What if we have 10 mail server and hosted at different VM. I was initially planned to use stream, but it can't differential the server_name and there is no other clue to differentiate either. for example username and so on. – woon minika Jul 27 '21 at 00:16
  • The Question is, how do you decide, WHAT mailserver should handle WHICH mail? – djdomi Jul 27 '21 at 04:23
  • we have 10 Mailserver hosting, each mail server represent it own accounts, we need to proxy a proper IP to this 10 mail servers. So stream does not work, WHY? 1. stream has no variable detection from what mail domain sending to? WHAT mailserver should handle WHICH mail? As i said stream cannot detect what mail server are you sending to, just proxy one to another one only – woon minika Jul 28 '21 at 04:06
  • Welcome to your [X-And-Y-Problem](https://faq-database.de/doku.php?id=en:x-and-y-problem) please ask your question in a way that all understood what you like to REAALY solve. – djdomi Jul 28 '21 at 04:12