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.
'spirit of sharing', Ken