One server however will not authenticate users. The same users can use FTP, telnet, etc. with no problems.
/usr/lib/security, /etc/pam.d, /usr/pkg/libexec/imapd and OS version are all identical.
I've done ktraces of: printf "a LOGIN user pass\na LOGOUT\n" | /usr/pkg/libexec/imapdThey do differ very slightly, but only (as far as I can see) down to the passwd files being larger on the non-working one (864 users vs 63 on a comparison server).
Compiling up imap-uw without PAM support gets it working, so it looks like a PAM problem, but I've run out of things to compare.
Any clues? -- Stephen