External Configuration
Your system may already be configured for a default LDAP server. For example, /etc/openldap/ldap.conf might contain:
bash
BASE ou=people,dc=gnu,dc=org
URI ldaps://ldap.gnu.org
TLS_CACERTDIR /etc/openldap/certsAuthentication requires a password, and a bind distinguished name (binddn) representing the user, in this case, gnu\emacsuser. These can be specified in ~/.authinfo.gpg with the following line:
bash
machine ldaps://ldap.gnu.org binddn gnu\emacsuser password s3cr3tThen in the .emacs init file, these expressions suffice to configure EUDC for LDAP:
emacs-lisp
(with-eval-after-load "message"
(define-key message-mode-map (kbd "TAB") 'eudc-expand-try-all))
(setopt eudc-server-hotlist
'(("" . bbdb)
("ldaps://ldap.gnu.org" . ldap)))
(setopt ldap-host-parameters-alist
'(("ldaps://ldap.gnu.org"
auth-source t)))For this example where we only care about one server, the server name can be omitted in ~/.authinfo.gpg and .emacs, in which case ldapsearch defaults to the host name in /etc/openldap/ldap.conf.
The ~/.authinfo.gpg line becomes:
binddn gnu\emacsuser password s3cr3tand the .emacs expressions become:
emacs-lisp
(with-eval-after-load "message"
(define-key message-mode-map (kbd "TAB") 'eudc-expand-try-all))
(setopt eudc-server-hotlist
'(("" . bbdb) ("" . ldap)))
(setopt ldap-host-parameters-alist
'(("" auth-source t)))