Housekeeping for source_map, more sanity checks on IMAP downloads