Nitpick.
Fix whitespace
occurence -> occurrence and other typos
do not meddle with queue.h by hand
Add a sentinel
fix double frees in ldap_close_connection
Change signature of ldap_close_connection
rename clean_filter
Use LDAPv3 instead of the default
Use scope from settings, assign msgid immediately.
Free event_signal
Do not write past the end of the array
Simplify and make create_filter more readable
Check that the filter is valid before processing the format.
Handle user nonexistence gracefully.
Arg handling was wrong
Simplify arg handling in imap_login.

We are hopefully on our way to proper argument parsing but not there yet.
Also we leak the copied string.
A mix of declaration and code
It should have been strdup all along
Temp for patch