small fixes for using imap as a backend

Signed-off-by: Arun Persaud <apersaud@lbl.gov>