imap: batch print messages