Take a look at RMails:
https://github.com/fanda/rmailsIt is Ruby on Rails application with Ruby scripts to autamate installation and configuration of E-mail server. Post-install configuration is done throught web application.
Still in development but already usable. I opensourced it and I hope that somebody could contribute.