diff --git a/en_US/howto/sql.create.mail.user.md b/en_US/howto/sql.create.mail.user.md index dd8d5820..97ec7486 100644 --- a/en_US/howto/sql.create.mail.user.md +++ b/en_US/howto/sql.create.mail.user.md @@ -8,8 +8,9 @@ instead. iRedMail ships the shell script `tools/create_mail_user_SQL.sh` to help you -create new mail user quickly. With some shell scripting trick, it's easy to -create many mail users. +create new mail user quickly. + +## Create a new mail user Sample usage: @@ -63,6 +64,23 @@ Notes: * Mailbox storage path is defined in variable `STORAGE_BASE_DIRECTORY`, default is `/var/vmail/vmail1`. +## Create multiple mail users + +With some shell scripting trick, it's easy to create many mail users. Just run +the script multiple times, but append the output SQL commands to same file. + +``` +# Create first user. With '>' to create or truncate file `/tmp/users.sql`. +bash create_mail_user_SQL.sh user1@domain.com 'password' > /tmp/users.sql + +# Append users. With '>>' to append to `/tmp/users.sql`. +bash create_mail_user_SQL.sh user2@domain.com 'password' >> /tmp/users.sql +bash create_mail_user_SQL.sh user3@domain.com 'password' >> /tmp/users.sql +bash create_mail_user_SQL.sh user4@domain.com 'password' >> /tmp/users.sql +``` + +Then import `/tmp/users.sql` once to create them all at the same time. + ## See Also * [LDAP: Bulk create mail users](./ldap.bulk.create.mail.users.html) diff --git a/html/sql.create.mail.user.html b/html/sql.create.mail.user.html index 25a322b8..9b1ef7ff 100644 --- a/html/sql.create.mail.user.html +++ b/html/sql.create.mail.user.html @@ -24,8 +24,8 @@ tutorial SQL: Bulk create new mail u instead.

iRedMail ships the shell script tools/create_mail_user_SQL.sh to help you -create new mail user quickly. With some shell scripting trick, it's easy to -create many mail users.

+create new mail user quickly.

+

Create a new mail user

Sample usage:

+

Create multiple mail users

+

With some shell scripting trick, it's easy to create many mail users. Just run +the script multiple times, but append the output SQL commands to same file.

+
# Create first user. With '>' to create or truncate file `/tmp/users.sql`.
+bash create_mail_user_SQL.sh user1@domain.com 'password' > /tmp/users.sql
+
+# Append users. With '>>' to append to `/tmp/users.sql`.
+bash create_mail_user_SQL.sh user2@domain.com 'password' >> /tmp/users.sql
+bash create_mail_user_SQL.sh user3@domain.com 'password' >> /tmp/users.sql
+bash create_mail_user_SQL.sh user4@domain.com 'password' >> /tmp/users.sql
+
+ +

Then import /tmp/users.sql once to create them all at the same time.

See Also