Question
How to create several mailboxes in Plesk at once using a single command or a script in the command line?
Answer
-
Create a file
mail.txt
using any text editor with a list of mail addresses and passwords for it:[email protected] password
[email protected] password
...
[email protected] passwordNote: Make sure that passwords comply with the current Password Strength Policy
-
Follow the instructions below for creating mailboxes from the
mail.txt
file:For Linux
-
Download the attached script:
# wget https://support.plesk.com/hc/en-us/article_attachments/12377375244567/createmail_.tar.gz
-
Unpack the downloaded archive:
# tar -zxvf createmail_.tar.gz
-
Execute the script:
# ./createmail.sh mail.txt
For Windows
-
Execute the command below to create mailboxes from the list created on step 2:
Note: In the example below,
mail.txt
file exists inC:mail.txt
. Adjust the path to themail.txt
file if requiredC:> 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
-mbox_quota
,-aliases
,-forwarding
etc., can be added to the commandplesk bin mail
in the script. For details on using these options, check the documentation articles: for Linux and for Windows. -