IMAP listener sliced to functions