cyrus-sasl2 denies authentication if host name unresolvable
This just cost me about >5 hours of debugging. cyrus-sasl2 does not authenticate against a server if the hostname is not dns-resolvable.
After upgrading to oneirc, I wondered, why the mail client mutt could access an imap server on three on my systems, but not on the fourth machine. It did not even try to authenticate after the imap server's greeting message and aborted with
"Error allocating SASL connection" , although the configuration files were identical.
After hours of debugging and analyzing with strace, tcpdump and source code I found that the reason was that the machine where it did not work was not known to my DNS name server. A query to it's (plain) hostname therefore failed. After modifying DNS to give an answer, SASL worked. Before, sasl_client_new() just gave a -1 as a result code.
This is broken by design. I did not even work if the server was at 127.0.0.1, and the machine and the authentication should really work even without DNS resolving.
DistroRelease: Ubuntu 11.10
Package: libsasl2-2 2.1.24~
Uname: Linux 3.0.0-12-generic i686
Date: Thu Nov 10 14:39:23 2011
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111011)
UpgradeStatus: No upgrade log present (probably fresh install)