SQL: Bulk create mail users

iRedMail ships the shell script tools/create_mail_user_SQL.sh to help you create many mail users quickly.

Sample usage:

# cd iRedMail-0.9.4/tools/
# bash create_mail_user_SQL.sh example.com user1 user2 user3

It will generate the plain SQL file output.sql in current directory, please login to SQL server as root user, then import it. for example:

# mysql -uroot -p
sql> USE vmail;
sql> SOURCE output.sql;
# cp output.sql /tmp
# chmod +r /tmp/output.sql

# su - postgres
$ psql -d vmail
sql> \i output.sql;


See Also