mail: Mail Accounts
The mail
utility is used to manage domain mail service and mail names (email accounts) through CLI. By using this utility, you can perform the following tasks:
- enabling or disabling mail service on subscriptions
- creating and deleting mail accounts
- editing mail account settings
- managing mail groups associated with mail accounts
Usage
mail <command> [<mail_name>] [
<option_1> [<param>]
[<option_2> [<param>]]
... [<option_N> [<param>]]
]
Example
The following command creates mail account JDoe@example.com, sets password mypass for it, sets the size of the email box to 50
MB, and enables the antivirus screening of both incoming and outgoing email messages for the mail account.
plesk bin mail --create JDoe@example.com -passwd mypass -mbox_quota 50M -antivirus inout
Commands
Command | Parameter | Description | Example |
---|---|---|---|
|
|
Creates a mail account. |
To create the mail account JDoe@example.com: plesk bin mail --create JDoe@example.com or plesk bin mail -c JDoe@example.com |
|
|
Updates mail account settings. |
To set the size of the mailbox for mail account JDoe@example.com to 50 MB: plesk bin mail --update JDoe@example.com -mbox_quota 50M or plesk bin mail -u JDoe@example.com -mbox_quota 50M |
|
|
Switches mail service on or off on a subscription. Requires the |
To enable mail service on the subscription example.com: plesk bin mail --update-service example.com -status enabled |
|
|
Renames a mail account. Required option |
To rename mail account JDoe@example.com to roy@example.com: plesk bin mail --rename JDoe@example.com -new roy |
|
|
Retrieves the list of email accounts. |
To see the list of email accounts: plesk bin mail -l |
|
|
Deletes a mail account. |
To delete mail account JDoe@example.com: plesk bin mail --remove JDoe@example.com or plesk bin mail -r JDoe@example.com |
|
|
Enables email service on a subscription. |
To enable email service on the subscription example.com: plesk bin mail --on example.com |
|
|
Disables email service on a subscription. |
To disable email service on the subscription example.com: plesk bin mail --off example.com |
|
|
Displays information about a mail account. |
To view information about mail account JDoe@example.com: plesk bin mail --info JDoe@example.com or plesk bin mail -i JDoe@example.com |
|
|
Displays help on the use of the utility. |
To view help on the use of the utility: plesk bin mail --help or plesk bin mail -h |
Options
Option | Parameter | Description | Example |
---|---|---|---|
|
|
Allows or prohibits managing the antivirus settings. |
To allow managing the antivirus settings for the mail account JDoe@example.com: plesk bin mail -u JDoe@example.com -manage-virusfilter true |
|
|
Allows or prohibits managing the spam filter settings. |
To allow managing the spam filter settings for the mail account JDoe@example.com: plesk bin mail -u JDoe@example.com -manage-spamfilter true |
|
|
Creates/Removes a mailbox. Is |
To create mail box for a mail account JDoe@example.com: plesk bin mail -u JDoe@example.com -mailbox true |
|
|
Sets the user password. For additional comments, see the Note below the table. |
To set the user password for the mail account JDoe@example.com to mypass: plesk bin mail -u JDoe@example.com -passwd mypass |
|
|
Specifies the type of user password. Ignored if no password is specified. |
To set the user password to sample and password type to encrypted for the mail account JDoe@example.com: plesk bin mail -u JDoe@example.com -passwd_type encrypted -passwd '$1$3KWwrPxB$b6GLpDPpQVsljMRgAlQZG/' |
|
|
Sets the size of the mailbox. Default mailbox quota for a domain to which an account belongs, if set to Is the default for the domain value by default. |
To set the mailbox quota for the mail account JDoe@example.com to 50 MB: plesk bin mail -u JDoe@example.com -mbox_quota 50M |
|
|
Adds/Removes mail aliases. |
To add mail aliases John and JohnDoe to mail account JDoe@example.com: plesk bin mail -u JDoe@example.com -aliases add:John,JohnDoe |
|
|
Adds a mail account to or removes a mail account from a mail group. |
To add mail account JDoe@example.com to the mail group testgroup: plesk bin mail -u JDoe@example.com |
|
|
Enables/Disables mail forwarding for a mail account. If set to Is |
To enable mail forwarding JDoe@example.com to JDoe@sample.com: plesk bin mail -u JDoe@example.com -forwarding true -forwarding-addresses add:JDoe@sample.com |
|
|
Specifies e-mail addresses to which incoming mail should be forwarded. It is required when enabling the |
|
|
|
Enables/Disables mail service on a subscription (the |
To enable mail service on the subscription example.com: plesk bin mail --update-service example.com -status enabled |
|
|
Specifies new mail account name. Used with |
To rename mail account JDoe@example.com to rroy@example.com: ./mail --rename JDoe@example.com -new rroy |
|
|
Specifies a description of an email address to be displayed in Plesk.
|
To create a description of the mail account JDoe@example.com: ./mail --update JDoe@example.com -description "A mailbox for JDoe" |
|
|
Displays the output in the JSON format. Used with the |
To see the list of mail accounts in the JSON format: ./mail -l -json |
|
|
Disables (
|
To enable the antivirus screening for all incoming e-mail messages addressed to JDoe@example.com: plesk bin mail -u JDoe@example.com -antivirus in |
|
|
Allows or prohibits logging in to the Control Panel with the specified email address as the username. This option, if ' To prohibit the corresponding existing user from logging in the the Control Panel, use ' |
To create the mail account user4@ example.com and the auxiliary user and to allow the user to log in to Control Panel with the email address as the user name and the password mypassword: plesk bin mail --create user4@example.com -passwd mypassword -cp-access true -mailbox true
To update the existing mail account user2@ example.com and create the auxiliary user who can log in to Control Panel with the email address as the user name and the password mypass: plesk bin mail --update user2@example.com -passwd mypass -cp-access true -mailbox true |
|
|
Sets the limit on outgoing messages from a mailbox (per hour).
To set the Unlimited value, specify "-1". Specify "default" to set the value specified in server-wide settings. |
To set the limit on outgoing messages per hour from the email address JDoe@example.com: plesk bin mail --update JohnDoe@example.com |
Note: Use of the -passwd
option is not recommended. Passing passwords through CLI as parameters of the -passwd
option may potentially compromise the system's security as command line can be observed by other users of the system. It is more secure to pass passwords through the environment variables. You can transfer non-encrypted passwords by using environment variable PSA_PASSWORD
while using single quotes to specify the empty values in the command line for the argument of the -passwd
option.
Similarly, you can transfer encrypted passwords through the environment variable PSA_CRYPTED_PASSWORD
while using single quotes to specify the empty values in the command line for the argument of the -passwd
option.