- Plesk for Linux
- Plesk for Windows
How to create several mailboxes at once using a single command or a script in command line?
Note: This article is intended for use by server administrators. In case there is no administrative SSH or RDP access to the server, contact the server administrator or server provider.
Create a file
mail.txtwith a list of mail addresses and a password for it:
CONFIG_TEXT: firstname.lastname@example.org password
Execute the following script to create mailboxes from the list in command line:
for Linux - download, unpack and execute the script
# wget https://support.plesk.com/hc/en-us/article_attachments/360014711094/createmail_.tar.gz
# tar -zxvf createmail_.tar.gz
# ./createmail.sh mail.txt
C:\> for /F "tokens=1,2 delims= " %i in (c:\mail.txt) do plesk bin mail.exe -c %i -passwd %j -mailbox true
Note: other options, like
-forwardingetc., can be added to the command
plesk bin mailin the script. For details on using these options, check the documentation articles: for Linux and for Windows.