Ensure the IMAP messages exists before fetching the attachment.