You should be able to write your own ldap server. Similar to https://github.com/Authentick/LdapServerLibrary/tree/main/Sample. There are ldap server libraries available in python and golang as well.
Once you write the server, sky is the limit as to what you do with the messages.