I'm looking for an IMAP testing tool, suitable to use with Dovecot IMAP. It needs to support TLS, STARTTLS, and login/authentication. It needs to be able run from command line, shell scripts, and even do so under cron jobs (e.g. a way to supply the password to use w/o a terminal prompt). Typical interactive mail clients just don't cut it (even the text mode ones). One reason is I need to do the tests on a number of machines, under a number of user and domain names, and with a variety of parameters or destinations. This is for a suite of regression tests I am putting together intended to verify that configuration changes do not break things (or unbreak things that are supposed to not work).
Anyone ever heard of such a tool? Open source would be preferred (better yet, my favorite programming languages: C, Pike, Python).