I have configured Postfix to work with SASL using plain text, where the former automatically submits a default realm to the latter when requesting authentication.
Assuming the domain name is example.com and the user is foo, here is how I configured it on my Debian system so far.
In the postfix configuration file
smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $mydomain
The SMTP configuration file
pwcheck_method: saslauthd mech_list: PLAIN
The SASL daemon is configured with the sasldb mechanism in
The SASL database file contains a single user, shown by
The authentication works well without having to provide a realm, as postifx does that for me. However, I cannot find out how to tell the Cyrus IMAP daemon to do the same.
I created a user
cyrus in my SASL database, which uses the realm of the host domain name, not
example.com, for administrative purpose. I used this account to create a mailbox through
cyradm for the user
IMAP is configured in
/etc/imapd.conf this way:
allowplaintext: yes sasl_minimum_layer: 0 sasl_pwcheck_method: saslauthd sasl_mech_list: PLAIN servername: mail.example.com
If I enable cross-realm authentication (
loginrealms: example.com), trying to authenticate using
imtest works with these options:
imtest -m login -a firstname.lastname@example.org localhost
However, I would like to be able to authenticate without having to specify the realm, like this:
imtest -m login -a foo localhost
I thought that using
virtdomains (setting it either to
defaultdomain: example.com would do just that, but I cannot get to make it work.
I always end up with this error:
cyrus/imap: badlogin: localhost [127.0.0.1] plaintext foo SASL(-13): authentication failure: checkpass failed
What I understand is that
cyrus-imapd never tries to submit the realm when trying to authenticate the user
My question: how can I tell
cyrus-imapd to send the domain name as the realm automatically?
Thanks for your insights!