I have a mail server setup with Postfix and Dovecot, and an application server setup with node.js. I have user credentials stored in my application server, and I want to use the same credentials for accessing the mail server. As I understand it, I should be able to use LDAP with Dovecot, handling authentication on a remote LDAP server - my application server.
Basically, is there any way I can run a 'fake' LDAP server, which uses my application's code to authenticate a username and password?
In a nutshell, I want to authenticate username and password requests to IMAP server using my application server.