On Tue, May 18, 2010 at 05:32:14PM -0400, Phil Howard wrote:
What I need is a program that already has all the logic to do IMAP as a client already in it. This isn't about testing IMAP logic per-se. It's about making sure mail is going through OK, and logins that should fail will fail, and mail deliveries that should fail will fail (for example mail from a computer listed as blocked should never show up in the mailbox designated to test that, along with mail that has keywords specifically marked as "is always spam").
Then you're testing the whole environment: you'll need to deliver mail either by making SMTP connections or by invoking your LDA (e.g. sendmail) and piping the mail in - with some way of forcing it to look "spammy" or "not spammy" - to check the blocking. Then you'll use IMAP to retrieve them. This is clearly more than testing just IMAP; rather, you're testing the whole mail server platform and its configs.
I did something like this for linnet.org (warning: ancient project). I wrote ruby scripts which would invoke exim for mail delivery, although rather than fetch them via IMAP I tested in the filesystem directly that they had arrived in the Maildir.
FWIW, the code is at rubyforge.org/projects/linnet (under "SCM", fetch cvs) and the tests are in src/test/test-exim.rb, but I'm certainly not suggesting you use this.
I don't know of any ready-made test framework for what you want, and I suspect it would end up looking much like a programming language by the time you were able to configure all the different tests for processing different flavours of incoming mail.
Regards,
Brian.