Question
How to create and manage an email account in Plesk?
Answer
-
Go to Domains > example.com > Email Addresses and click Create Email Address.
Note: Email Addresses and Email Settings will be hidden in domain dashboard, if the mail management is disabled server-wide.
-
Fill in the fields and click OK.
-
Leave the Mailbox checkbox selected. Clear this checkbox if it is needed to use this email address as a mail forwarder, which will forward all incoming mail to another address.
-
-
Connect to a Plesk server via SSH (Linux) / RDP (Windows Server).
-
To create an email account, run the following command (on Windows Server, use a command prompt as an Administrator):
# plesk bin mail --create [email protected] -passwd "your_password" -mailbox true
-
To get the list of mail accounts, run the following command:
# plesk bin mail --list
To learn more about the 'plesk bin mail' utility options, refer to these Plesk Documentation pages:
Note: Replace 203.0.113.2 and ce8b9a38-4410-XXX with the required server IP address and API key from step 2 in exactly the same way as all the
custom settings in the commands below.
Note: In step 2, the API key should be generated from the Plesk server where the request for creating an email account is run.
-
Connect to a Plesk server via SSH (Linux) / RDP (Windows Server).
-
Generate a API key:
# curl -k -X POST --user admin:"<password>" -H "Content-Type: application/json" -H "Accept: application/json" -d"{}" "https://203.0.113.2:8443/api/v2/auth/keys"
or
# plesk bin secret_key -c -ip-address 203.0.113.2
-
Create an email account via REST API:
# curl -k -X POST -H "X-API-Key: ce8b9a38-4410-XXX" -H "Content-Type: application/json" -H "Accept: application/json" "https://203.0.113.2:8443/api/v2/cli/mail/call" -d '{ "params": ["--create", "[email protected]", "-passwd", "<password>", "-mailbox", "true"]}'
To learn more about REST API, refer to these Plesk Documentation pages: