imaputils is a tool for managing/searching mail on an IMAP server. It's a CLI tool written in Perl. It searches using the native IMAP server's capabilities (by date, mail header, etc.). Move or copy between mailboxes, current tar ball is same server only. Git head is recommended. It has several additional features (e.g. server to server copy/move).