I have a couple of domains which I need to receive emails for. I have set up Mailcow and when I set the MX records of the domains to the Mailcow server. Email is received successfully.

However, I need to have unique MX records for each domain. So I have set up an A record for mail for the domain pointing to the server which is running Nginx with the mail directive to proxy mail off to the Mailcow server.

However the mail is not being received.

This is the Nginx configuration I am using:

server {
            server_name localhost;
            access_log /var/log/nginx/localhost.access_log;
            error_log /var/log/nginx/localhost.error_log;

        root /var/www/localhost/htdocs;

        location ~ .php$ {
                add_header Auth-Server MailcowServerIP;
                add_header Auth-Port 25;
                return 200;

mail {

  server_name mail.domain.com;

        auth_http localhost:8008/auth-smtppass.php;

        server {
                listen 25;
                protocol smtp;
                timeout 5s;
                proxy on;
                xclient off;
                smtp_auth none;


Any feedback on why the emails are not being received, please? I only need this proxy for receiving emails so there is no need for authentication I guess?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.