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:
Syntax
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, disables Plesk GUI access to this mail account, 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.
# ./mail --create JDoe@example.com -passwd mypass -cp-access false -mbox_quota 50M -antivirus inout
Commands
Command |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Creates a Plesk mail account. |
To create the mail account JDoe@example.com: # ./mail --create JDoe@example.com or # ./mail -c JDoe@example.com |
|
|
Updates a mail account settings. |
To set the size of the email box for mail account JDoe@example.com to 50 MB: # ./mail --update JDoe@example.com -mbox_quota 50M or # ./mail -u JDoe@example.com -mbox_quota 50M |
|
|
Updates mail service status on a domain. Requires the |
To enable mail service on the domain example.com: # ./mail --update-service example.com -status enabled |
|
|
Deletes a mail account. |
To delete mail account JDoe@example.com: # ./mail --remove JDoe@example.com or # ./mail -r JDoe@example.com |
|
|
Enables email service on a domain. |
To enable email service on the domain example.com: # ./mail --on example.com |
|
|
Disables email service on a domain. |
To disable email service on the domain example.com: # ./mail --off example.com |
|
|
Displays information about a mail account. |
To view information about mail account JDoe@example.com: # ./mail --info JDoe@example.com or # ./mail -i JDoe@example.com |
|
|
Displays help on the use of the utility. |
To view help on the use of the autoresponder utility: # ./mail --help or # ./mail --h |
Options
Option |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Allows/Prohibits accessing Plesk GUI (as opposite to using Plesk API). Is Deprecated. Use |
To prohibit JDoe@example.com from accessing to Plesk GUI: # ./mail -u JDoe@example.com -cp_access false |
|
|
Allows/Prohibits accessing Plesk GUI (as opposite to using Plesk API). Is |
To prohibit JDoe@example.com from accessing to Plesk GUI: # ./mail -u JDoe@example.com -cp-access false |
|
|
Creates/Removes a mailbox. Is |
To create mail box for a mail account JDoe@example.com: # ./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: # ./mail -u JDoe@example.com -passwd mypass |
|
|
Specifies the type of user password. Ignored if no password is specified. For additional comments, see the Note below the table. |
To set the user password to sample and password type to encrypted for the mail account JDoe@example.com: # ./mail -u JDoe@example.com -passwd_type encrypted -passwd sample |
|
|
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: # ./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: # ./mail -u JDoe@example.com -aliases add:John,JohnDoe |
|
|
Adds/Removes a mail account to/from Plesk mail groups. |
To remove JDoe@example.com from mail groups Partners and VIPs: # ./mail -u JDoe@example.com -mgroups del:Partners,VIPs |
|
|
Allows/Prohibits redirecting mail messages. If set to Is |
To allow JDoe@example.com to redirect mail messages to email address JDoe@sample.com: # ./mail -u JDoe@example.com -redirect true -rediraddr JDoe@sample.com |
|
|
Specifies an email address to which incoming mail will be forwarded upon receipt. Required with |
To set up redirecting mail for JDoe@example.com to email address John@example.com: # ./mail -u JDoe@example.com -redirect true -rediraddr John@example.com |
|
|
Allows/Prohibits a mail group associated with a mail account. |
To allow mail group associated with mail account JDoe@example.com: # ./mail -u JDoe@example.com -group true |
|
|
Adds/Removes email addresses to/from a mail group associated with a mail account. |
To add email addresses Jane@example.com and Mike@sample.com to the mail group associated with mail account JDoe@example.com: # ./mail -u JDoe@example.com -groupmem add:Jane@example.com,Mike@example.org |
|
|
Allows/Prohibits multiple simultaneous sessions under mail user's login. |
To allow multiple sessions to run simultaneously under mail user login JDoe@example.com: # ./mail -u JDoe@example.com -multiple-sessions true |
|
|
Specifies which language is used in a mail user's control panel interface. 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 JDoe@example.com to Russian: # ./mail -u JDoe@example.com -locale -ru-RU |
|
|
Limits the button length (in symbols) for mail user's control panel interface. |
To set the button label length for JDoe@example.com control panel interface to 20: # ./mail -u JDoe@example.com -max-button-length 20 |
|
|
Prevents/Allows working with Plesk until page is completely loaded. Is |
To allow JDoe@example.com to work with the control panel interface even if control panel screens are not completely loaded: # ./mail -u JDoe@example.com -lock-screen false |
|
|
Specifies the default skin for mail user's control panel interface. |
To set the WinXP Olivegreen skin as the default interface skin for the JDoe@example.com: # ./mail -u JDoe@example.com -skin "WinXP Olivegreen" |
|
|
Enables/Disables mail service on a domain (the The use of 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: ./mail --update-service example.com -status parent |
|
|
Allows/Prohibits managing Dr.Web antivirus application. Deprecated since Plesk 8.1. Use |
To allow JDoe@example.com to manage Dr.Web antivirus application: # ./mail -u JDoe@example.com -manage-drweb true |
|
|
Allows/Prohibits managing spam filter. |
To allow JDoe@example.com managing spam filter: # ./mail -u JDoe@example.com -manage-spamfilter true |
|
|
Disables (
|
To enable the antivirus screening for all incoming e-mail messages addressed to JDoe@example.com: # ./mail -u JDoe@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.