0

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.

penalosa
  • 429
  • 1
  • 4
  • 5

1 Answers1

1

If you want to run a 'fake' LDAP server that uses your code, it sounds like you are going to implement your own directory-server that uses your code in the backend. It might sound frightening but it is completely doable. If you use Java and Spring, for example, you can use spring-ldap, and implement your own LdapTemplate instance that uses your code to get the users/passwords etc.

However, note that Dovecot also supports SQL, so it might be a better idea for you.

OhadR
  • 203
  • 1
  • 6