The mailserver utility is used to manage Plesk mail server settings through CLI. By using this utility, you can perform the following tasks:
Syntax
mailserver <command> [
<option_1> [<param>]
[<option_2> [<param>]]
…[<option_N> [<param>]]
]
Example
The following command line sets the relaying mode that requires authorization, specifies the POP3 authorization type for mail users, and set the lock time to 10 min:
# ./mailserver --set-relay auth -auth-type pop3 -lock-time 10
Commands
Command |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Sets the relaying mode for the mail server (the Relaying parameter).
Set to |
To set the Plesk mail server relaying mode requiring authorization (authorization is required), specify the POP3 authorization, and set the lock time of 20 min: # ./mailserver --set-relay auth -auth-type pop3 -lock-time 20
|
|
|
Sets the maximum message size that can be accepted by the mail server (the Maximum letter size parameter). |
To set the maximum message size that can be accepted by the mail server to 500 KB: # ./mailserver --set-max-letter-size 500K |
|
|
Enables or disables the Trend Micro RBL+ Service (formerly Mail Abuse Prevention System, MAPS).(the Enable support for Trend Micro RBL+ Service parameter). At least one DNS server of the Trend Micro RBL+ Service must already be specified. |
To enable Trend Micro RBL+ Service on the mail server: # ./mailserver --set-maps-status true |
|
|
Adds one or more Trend Micro RBL+ Service (formerly Mail Abuse Prevention System, MAPS) zones to the mail server (the DNS zones for RBL+ Service parameter). |
To add host names maps1.example.com and maps2.example.com to the list of Trend Micro RBL+ servers to be queried by the Trend Micro RBL+ Service: # ./mailserver --add-maps-zone maps1.example.com,maps2.example.com |
|
|
Removes one or more Trend Micro RBL+ Service (formerly Mail Abuse Prevention System, MAPS) to the mail server (the DNS zones for RBL+ Service parameter). |
To remove host names maps1.example.com and maps2.example.com from the list of Trend Micro RBL+ servers to be queried by the Trend Micro RBL+ Service: # ./mailserver --remove-maps-zone maps1.example.com,maps2.example.com |
|
|
Specifies the mail user login name format for accessing mail accounts by means of the POP3 or IMAP protocols (the Names for POP3/IMAP mail accounts parameter).
Is set to |
To allow using both the "short" and "full" login name formats for mail users to access their mail accounts by means of the POP3 or IMAP protocols on the mail server: # ./mailserver --set-account-type both |
|
|
Enables or disables checking mail user passwords against the dictionary of simple passwords to prevent dictionary attacks (the Check the passwords for mailboxes in the dictionary parameter). |
To enable preventive checking of mail user passwords against the password dictionary to prevent use of simple passwords by users: # ./mailserver --use-vocabulary true |
|
|
Adds one or more domain names to the mail server's Black list. |
To add domains commerce.example.org and commerce.example.net to the mail server's black list: # ./mailserver --add-to-black-list commerce.example.org,commerce.example.net |
|
|
Removes one or more domain names from the mail server's Black list. |
To remove domains commerce.example.org and commerce.example.net from the black list: # ./mailserver --remove-from-black-list commerce.example.org,commerce.example.net |
|
|
Adds one or more subnet masks to the mail server's White list. |
To add subnets 192.168.64.0/24 and 192.168.0.0/16 to the mail server's white list: # ./mailserver --add-to-white-list 192.168.64.0/24,192.168.0.0/16 |
|
|
Removes one or more subnet masks from the mail server's White list. |
To add subnets 192.168.64.0/24 and 192.168.0.0/16 to the mail server's white list: # ./mailserver --add-to-white-list 192.168.64.0/24,192.168.0.0/16 |
|
|
Updates the SPF (Sender Policy Framework) settings. |
To enable the SPF spam protection on the mail server: # ./mailserver --update-spf -spf-status true |
|
|
Displays mail server settings:
|
To display the SPF (Sender Policy Framework) settings: # ./mailserver --info spf or # ./mailserver -i spf |
|
|
Displays help on the use of the utility. |
To display help on the use of the mailserver utility: # ./mailserver --help or # ./mailserver -h |
Options
Option |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Specifies mail user authorization type during mail relaying. |
To set the relaying mode that requires authorization, specify the POP3 authorization type, and set the lock time to 10 min: # ./mailserver --set-relay auth -auth-type pop3 -lock-time 10
|
|
|
Sets the lock time for POP3 authorization (in minutes). Required for |
|
|
|
Enables or disables the SPF (Sender Policy Framework) spam protection on the mail server. Used only with the |
To enable the SPF (Sender Policy Framework) spam protection on the mail server: # ./mailserver --update-spf -spf-status true |
|
|
Sets the SPF behavior (the SPF checking mode parameter).
Used only with the |
To set SPF behavior to Reject mails when SPF resolves to "fail" (deny): # ./mailserver --update-spf -spf-behavior 3 |
|
|
Sets SPF rules that will be applied for domains that do not conform to the SPF policies (are not publishing SPF records)(the SPF local rules parameter). Used only with the |
To set the following SPF rule include:spf.trusted-forwarder.org: # ./mailserver --update-spf -spf-rules "include:spf.trusted-forwarder.org" |
|
|
Sets SPF rules that will be applied if SPF checks return "fail", "softfail", or "neutral" (the SPF guess parameter). Used only with the |
To set the following SPF rule include:spf.trusted-forwarder.org: # ./mailserver --update-spf -spf-guess "include:spf.trusted-forwarder.org" |
|
|
Sets the message text that will be received by the sender (SMTP client) of a message rejected as a result of SPF check (the SPF explanation text parameter). Used only with the |
To set the SPF explanation text "You message does not conform to the SPF policies" to be included in the automatically generated replies to to senders of messages rejected as a result of SPF check: # ./mailserver --update-exp -spf-guess "include:spf.trusted-forwarder.org" |