Added delay preference and IMAP IDLE functionality