How to create mail accounts in bulk using CLI in Plesk for Linux?
The following command can iterate through a list of email addresses and create them using the command-line Mail utility:
Connect to the server via SSH
Create a list of mail addresses to be created with one mail address per line as in the following example:
Note: In this example,
maillist.txtis the name of the file containing the mail address list.
Run the following command on the same directory where the file is located. This will iterate the list and create the accounts included in the file:
# for i in `cat maillist.txt`; do plesk bin mail --create $i -mailbox true; done
The output should look like the following:
Once accounts are created, each email owner will have to set a password at Domains > example.com > Mail > Email Addresses > [email protected] > Password.