Use imap to add timeout