Writing an custom imap command