If your imap server is a machine that you can ssh to you can put
set tunnel='ssh -q machineaddress /usr/sbin/imapd'
in your .muttrc, which tells mutt to talk to the imap server through an ssh tunnel; this works even if ssl is not compiled in to mutt, as it uses the external ssh. It also works if ssl is not compiled in to the imap server, which can be configured to accept connections only from its localhost.
Another approach to looking up addresses in AddressBook is covered here:
It also uses the
set query_command but with a different back end.