Setting up multiple mailboxes manually can be time-consuming. This guide will walk you through using a script to automate the mailbox creation process in Plesk by referencing a list of email addresses and passwords stored in a file.
Prerequisites
- SSH access to your server with appropriate privileges.
- A text editor (e.g.,
nano
orvim
) to create the file of email addresses and passwords.
Step-by-Step Instructions
- SSH into Your Server
Connect to your server via SSH:
Replacessh [username]@[server_ip]
[username]
with your SSH username and[server_ip]
with the IP address of your server. - Create a File with Mailbox Information
Create a new file,mail.txt
, to list the email addresses and their associated passwords.touch mail.txt
Open
mail.txt
with your preferred text editor and format it as follows:mail-address1@example_domain.com $password mail-address2@example_domain.com $password mail-address3@example_domain.com $password mail-addressN@example_domain.com $password
Note: Ensure all passwords comply with your server's Password Strength Policy to avoid errors during mailbox creation.
- Download the Mailbox Creation Script
Download the pre-configured script provided by Plesk for bulk mailbox creation:wget https://support.plesk.com/hc/en-us/article_attachments/12377375244567/createmail_.tar.gz
- Unpack the Script Archive
Extract the contents of the downloaded archive:tar -zxvf createmail_.tar.gz
- Run the Script to Create Mailboxes
Execute the script, specifyingmail.txt
as the input file:./createmail.sh mail.txt
Additional Information
Using this script simplifies the process of creating multiple mailboxes based on predefined credentials. This can be especially useful for setting up mail accounts in bulk for teams or departments.
Disclaimer
Ensure you have permission to execute scripts on your server and verify compliance with your server's security policies. Run tests in a staging environment if possible before applying on a production server.