The mail utility is used to manage domain mail service and mail names (e-mail accounts) through CLI. By using this utility, you can perform the following tasks:
Syntax
mail <command> [<mail name>] [
<option_1> [<param>]
[<option_2> [<param>]]
…[<option_N> [<param>]]
]
Example
The following command line creates mail name admin@example.com, enables Plesk control panel access for the mail user with login name admin@example.com, sets password userpass for the mail user to access the control panel, sets the size of the e-mail box to 50 MB, and enables the Dr.Web antivirus screening of both incoming and outgoing e-mail messages for the mail name.
# ./mail --create admin@example.com -cp-access true -passwd userpass -mbox_quota 50MB -drweb inout
Commands
Command |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Creates a Plesk mail name (an e-mail account). |
To create a Plesk mail name example.com: # ./mail -create admin@example.com or # ./mail -c admin@example.com |
|
|
Updates mail name settings. |
To set the size of the e-mail box to 50 MB for mail name admin@example.com: # ./mail --update admin@example.com -mbox_quota 500 or # ./mail -u admin@example.com -mbox_quota 50M |
|
|
Updates mail service status on a domain. Requires concomitant use of the |
To enable mail service on domain example.com: # ./mail --update-service example.com -status enabled
|
|
|
Deletes a mail name from Plesk. |
To delete mail name admin@example.com from Plesk: # ./mail --remove admin@example.com or # ./mail -r admin@example.com |
|
|
Enables e-mail service on a domain. |
To enable e-mail service on domain example.com: # ./mail --on example.com |
|
|
Disables e-mail service on a domain. |
To disable e-mail service on domain example.com: # ./mail --off example.com |
|
|
Displays information about a mail name. |
To display information about Plesk mail name admin@example.com: # ./mail --info admin@example.com or # ./mail –i admin@example.com |
|
|
Displays help on the use of the utility. |
To display help on the use of the autoresponder utility: # ./mail --help or # ./mail --h |
Options
Option |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Enables or disables mail name user to Plesk control panel (the Control panel access parameter). Set to |
To enable access to control panel for user of mail name admin@example.com: # ./mail -u admin@example.com -cp_access true |
|
|
Creates or deletes mail box for a mail name. |
To delete mail box for a mail name admin@example.com: # ./mail -u admin@example.com -mailbox false |
|
|
Sets the user password for a mail name. For additional comments, see the Note below the table. |
To change user password to userpass for mail name admin@example.com: # ./mail -u admin@example.com -passwd userpass |
|
|
Specifies the type of user password. Ignored if no password is specified. For additional comments, see the Note below the table. |
To set the type of user password to encrypted for mail name admin@example.com: # ./mail -u admin@example.com -passwd_type encrypted |
|
|
Sets the size of the mail box for a mail name. Type Set to the Default for the domain value by default. |
To set the size of the mail box for a mail name admin@example.com to 50 MB: # ./mail -u admin@example.com -mbox_quota 50M |
|
|
Adds to or deletes e-mail aliases from a mail name. |
To add e-mail aliases serveradmin and webadmin mail aliases to mail name admin@example.com: # ./mail -u admin@example.com -aliases add:webadmin,serveradmin |
|
|
Adds to or removes a mail name from Plesk mail groups (Groups). |
To remove admin@example.com from mail groups Partners and VIPs: # ./mail -u admin@example.com -mgroups del:Partners,VIPs |
|
|
Enables or disables redirecting mail messages for a mail name (Redirect). If set to true, requires concomitant use of the |
To enable redirecting e-mail messages for mail name admin@example.com to e-mail address traveladmin@example.com: # ./mail -u admin@example.com -redirect true -rediaddr admin@example.com@redirect.com |
|
|
Specifies an e-mail address to which incoming mail for a mail name will be forwarded upon receipt. |
To set up redirecting mail for mail name admin@example.com to e-mail address traveladmin@example.net: # ./mail -u admin@example.com -redirect true -rediaddr traveladmin@example.net |
|
|
Enables or disables a mail group associated with a mail name. |
To enable mail group associated with mail name admin@example.com: # ./mail -u admin@example.com -group enable |
|
|
Adds to or removes e-mail addresses from a mail group associated with a mail name. |
To add e-mail addresses admin@example.net and admin@example.org to the mail group associated with mail name admin@example.com: # ./mail -u admin@example.com -groupmem add:admin@example.net,admin@example.org |
|
|
Allows multiple simultaneous sessions under mail user's login (the Allow multiple sessions parameter). |
To allow multiple sessions to run simultaneously under mail user login admin@example.com : # ./mail -u admin@example.com -multiple-sessions true |
|
|
Sets the default interface language for mail user's control panel (the Interface language parameter). The argument of the command must be a valid four-letter language code derived from the language code described in ISO-639-2 and the corresponding country code described in ISO-3166. For example, the Plesk code for the Italian language code is |
To set the default interface language for mail user with login name admin@example.com to Russian: # ./mail -u admin@example.com -locale -ru-RU |
|
|
Sets the maximum allowed button length (in symbols) for mail user's control panel (the Button label length parameter). |
To change the button label length to 20 for the control panel for the mail user with login name admin@example.com: # ./mail -u admin@example.com -max-button-length 20 |
|
|
Sets the Prevent users from working with the control panel until interface screens are completely loaded parameter. |
To prevent mail user with login name admin@example.com from working with the control panel until control panel screens are completely loaded: # ./mail -u admin@example.com -lock-screen true |
|
|
Sets the default interface skin for mail user's control panel (the Interface skin parameter). |
To set the WinXP Olivegreen skin as the default interface skin for the mail user with login name admin@example.com: # ./mail -u admin@example.com -skin "WinXP Olivegreen" |
|
|
Enables or disables mail service on a domain (the |
To enable mail service on domain example.com: # ./mail --update-service example.com -status enabled To set the status of mail service on domain example.com to the status of the domain: ./domain --update-service example.com -status parent |
|
|
Enables or disables Dr.Web antivirus application management by a mail user (the Dr.Web antivirus management permission). |
To enable management of the Dr.Web antivirus application by the mail user with login name admin@example.com: # ./mail -u admin@example.com -manage-drweb true |
|
|
Enables or disables spam filter management by a mail user (the Spam filter management permission). |
To enable spam filter management by the mail user with login name admin@example.com: # ./mail -u admin@example.com -manage-spamfilter true |
|
|
Disables (
|
To enable the Dr.Web antivirus screening for all incoming e-mail messages addressed to mail name admin@example.com: # ./mail -u admin@example.com -antivirus in |
Note: Use of this 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 - -passwd_type options.
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 and -passwd_type options.