*) Check file iRedMail-x.y.z/config after iRedMail installation, it's generated during installation wizard. iRedMail will detect whether this file exists before showing you configuration wizard (ask for first mail domain, mysql root password, etc), if it exists, iRedMail asks you whether to use it directly or generating a new one.
*) You can write a shell script to perform some after-install tasks if necessary, like updating hostname for new VPS.
Here's how i preform iRedMail test daily with VMware Fusion, all are completed with a shell script and VMware command line tool "vmrun" and "scp", "ssh". Hope it helps.
*) Install a clean, basic/minimal OS (Debian/CentOS/openSUSE/OpenBSD/etc), set proper hostname, then create snapshot.
*) Revert VM to the latest snapshot (a clean, basic, minimal OS) with "vmrun".
*) Start this VM with "vmrun", sleep 30 (or 60) seconds waiting for OS start up.
*) Detect network connection to this VM, if it's up, upload required files with "scp": The latest development edition of iRedMail, source tarballs required by iRedMail (Roundcube, iRedAdmin, iRedAPD, etc), the downloaded Debian/CentOS/openSUSE/OpenBSD binary packages, etc. The most important one is a prepared iRedMail config file: iRedMail-x.y.z/config.
*) Create/Update iRedMail installation status file: iRedMail-x.y.z/.status to skip downloading source tarballs, etc.
*) Perform installation via ssh like this:
ssh root@[SERVER] "cd /root/iRedMail/ && IREDMAIL_DEBUG='NO' AUTO_USE_EXISTING_CONFIG_FILE=y AUTO_INSTALL_WITHOUT_CONFIRM=y AUTO_CLEANUP_REMOVE_SENDMAIL=y AUTO_CLEANUP_REMOVE_MOD_PYTHON=y AUTO_CLEANUP_REPLACE_FIREWALL_RULES=y AUTO_CLEANUP_RESTART_IPTABLES=y AUTO_CLEANUP_REPLACE_MYSQL_CONFIG=y AUTO_CLEANUP_RESTART_POSTFIX=n bash iRedMail.sh "
*) Perform after-installation tasks: upload downloaded ClamAV database, ..., reboot server.
It should be finished in 2-3 minutes (uploading binary packages takes most time), then i got a working iRedMail server. I do this many times everyday.
I have 4 prepared iRedMail config files for different backends: OpenLDAP, MySQL, PostgreSQL, ldapd (OpenBSD only). i run my script with an option to install iRedMail with specified backend like below, the script will upload proper config file to server:
# bash my_script.sh ldap
# bash my_script.sh mysql
# bash my_script.sh pgsql
# bash my_script.sh ldapd