Creating mailboxes in ONLYOFFICE Mail using a script
Starting from v1.6.57, it is possible to run a script after the container has started to modify the default settings of the onlyoffice-mail-server. To create mailboxes, follow the steps below.
Execute the following command:
docker exec -it onlyoffice-mail-server bash
Go to the directory that contains scripts:
cd /usr/src/iRedMail/tools/scripts/
Prepare the CSV file containing the list of mailboxes to be created and save the file in the CSV format, for example mailboxes.csv.
Below is an example of the mailboxes.csv file:
Email,Password
zzz@example.com,pwd123
yyy@example.com,qwerty123
Run the script to create the mailboxes:
python create_mailboxes.py -d "onlyoffice-mysql-server" -u "root" -p "my-secret-pw" -dn "onlyoffice_mailserver" -mb "mailboxes.csv"
note
Running the script again will not create duplicate entries.
To perform other operations using the script, refer to the following articles: