Following the comment by @nikita-kipriyanov (which helped me to focus on SASL Dovecot) I successfully established a SMTP server with Postfix and Dovecot SASL.
This is approximately what I did:
I realized that I should focus on Dovecot and understand why it fails to authenticate.
I found that Dovecot files are at path /etc/dovecot
.
I had read about Dovecot SASL logging here:
https://doc.dovecot.org/admin_manual/logging/
then I changed Dovecot logging configs in file /etc/dovecot/conf.d/10-logging.conf
such that the logging file is at path /var/log/dovecot.log
.
Additionally, I made the logging much more verbose (enabled 6 config variables).
Then, from Dovecot log file I realized that the authentication mechanism is PAM, which is a standard users authentication mechanism in the OS.
Also, the dovecot SASL uses the "passdb" with is the password database - read about here:
https://doc.dovecot.org/configuration_manual/authentication/password_databases_passdb/
As can be seen, the password database supports PAM among other things.
Also I noticed in the dovecot log file that the username to this PAM module is the string before the @
of the email address.
For example if the email address is [email protected]
, then the username to PAM is bar
.
So I added a user to the Linux-based OS which is called bar
and applied a password to it which is the same email password.
Then, the authentication was successful and email was received.
saslpasswd2
utility if it was set up to use sasldb, or put passwords into MySQL database if set to auxiliary sql; something similar should be done for Dovecot SASL. Notice: it's possible you're using Cyrus SASL library actually (even if your IMAP server is Dovecot, that's a yet different thing); to know for sure, runpostconf smtpd_sasl_type
.postconf -n
into your question for us to see what you were changed in the Postfix configuration.