I’ve been looking into configuring a new mail server. My old server is using ISPConfig. In my student days and some time after, I used to host websites for third parties, but I am no longer into that, so for the new server, I won’t be using ISPConfig. I’ll keep it simpler. Something like PostfixAdmin will be more then enough for my email needs. (Other services will be addressed at a later point) Yesterday, I’ve spend all day trying to get the mail server to behave.

I’ve got myself a new VPS, running Debian 12. I’ve been using the Linux Bible, also known as the ArchLinux Wiki. Virtual user mail system with Postfix, Dovecot and Roundcube.

Following those instructions, I ran into trouble sending emails. It seems, postfix wasn’t able to authenticate against dovecot when configured using those instructions.

Postfix has

smtpd_sasl_path = /var/run/dovecot/auth-client

And Dovecot has

service auth {
    unix_listener auth-client {
        group = postfix
        mode = 0660
        user = postfix
    }
    user = root
}

The socket /var/run/dovecot/auth-client clearly exists, yet postfix thinks it does not.

postfix/smtpd[114504]: warning: SASL: Connect to Dovecot auth socket '/var/run/dovecot/auth-client' failed: No such file or directory
postfix/smtpd[114504]: fatal: no SASL authentication mechanisms

Turns out, postfix only accepts relative paths, no absolute paths. The solution is to change the locations, such that postfix has its relative path, and then dovecot gets an absolute path configured. Thus,

Postfix gets

smtpd_sasl_path = private/auth

And Dovecot gets

service auth {
    unix_listener /var/spool/postfix/private/auth {
        group = postfix
        mode = 0660
        user = postfix
    }
    user = root
}

So, we specify an absolute path to dovecot, and a relative path to postfix. With this configuration, the SASL communication between postfix and dovecot works.