Update: I did get this working. I had “When lookup up addresses:” under Account Settings –> [account name here] –> Composition & Addressing set to “Use a different LDAP server:” none. Changing it to my LDAP server resolved the issue. Keep in mind this was after implementing the fixes from the BUG report linked below. The LDAP workaround is still nice though if you just want to sync occasionally.

Issue#

Thunderbird has had a bug open for 15 years that causes the TO box in the message composition window to not load contacts from an LDAP directory server. The directory server works in the contacts side panel and main address book tab, but not in the new message autofill box for TO/CC/BCC.

https://bugzilla.mozilla.org/show_bug.cgi?id=668087

Many workarounds exist, however none of them worked for me. Maybe I will get around to fixing it and submit a patch. But nobody has for 15 years so I think I have time ;)

Workaround#

Since my directory does not change very often, I setup the LDAP server connection and then triggered the offline download. This creates an ldap.sqlite file in your thunderbird profile. To find your profile, go to Help –> Troubleshooting Information and click the about:profiles link under “Application Basics”. This will pull up a screen giving you the locations of your profiles.

Open the address book window. Select “Import” in the bottom left. Select “SQLite database file” and navigate to your profile path. Select the ldap.sqlite file and import.

Now, to refresh the local directory, I simply open the LDAP address book properties panel. Select Offline –> Download Now, and then re-import the ldap.sqlite file.

Other Changes#

For me, the TO box would still pull up the contact name as the CN, not the displayName attribute. To change this, I went into Advanced Preferences and changed the value of ldap_2.servers.default.attrmap.DisplayName to displayName. Future self, you are welcome.