Cleanup-maildir is a project mainly written in Python, it's free.
Fork of Nathaniel W. Turner's Python script
Original from http://svn.houseofnate.net/unix-tools/trunk/cleanup-maildir