Thanks for information. Helps clarify the problem.
To be honest, have never attempted IMAP authentication for Moodle so most of my questions are more 'food for thought' than anything else.
However, that being said, have you turned on debugging in Moodle to see if it says anything?
Think the issue is related to pam_winbind ... ie, PAM. IMAP uses PAM but might not be able to communicate with the Moodle server. Maybe the authentication method should be PAM.
http://docs.moodle.org/22/en/PAM_%28Pluggable_Authentication_Modules%29
'spirit of sharing', Ken