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 sets the relaying mode that requires authorization, specifies the POP3 authorization type for mail users, and set the lock time to 10 minutes:
# ./mailserver --set-relay auth -auth-type pop3 -lock-time 10
Commands
Command |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Specifies the mail relay mode for the mail server. |
To set the Plesk mail server relaying mode to "authorization is required" ( # ./mailserver --set-relay auth |
|
|
Limits the maximum message size that can be accepted by the mail server. |
To restrict the maximum message size that can be accepted by the mail server to 2 M: # ./mailserver --set-max-letter-size 2M |
|
|
Enables/Disables MAPS (Mail Abuse Prevention System) spam protection. |
To enable MAPS spam protection on the mail server: # ./mailserver --set-maps-status true |
|
|
Adds one or more domain names to the MAPS spam protection list. |
To add domain names maps1.example.com and maps2.example.com to the MAPS spam protection list: # ./mailserver --add-maps-zone maps1.example.com,maps2.example.com |
|
|
Removes one or more domain names from the MAPS spam protection list. |
To remove domain names maps1.example.com and maps2.example.com from the MAPS spam protection list: # ./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.
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/Disables checking mail user passwords against the dictionary of simple passwords to prevent users from setting simple passwords. |
To enable checking of mail user passwords against the password dictionary to prevent users from setting simple passwords: # ./mailserver --use-vocabulary true |
|
|
Adds one or more domain names to the mail server black list. |
To add domain names example.org and sample.example.net to the black list of mail server: # ./mailserver --add-to-black-list example.org,sample.example.net |
|
|
Removes one or more domain names from the black list of mail server. |
To remove domain names sample.example.org and forum.example.net from the mail server black list: # ./mailserver --remove-from-black-list sample.example.org,forum.example.net |
|
|
Adds one or more IP addresses/subnet masks to white list of the mail server. |
To add 192.0.2.0/24 and 192.0.2.3/16 to the mail server white list: # ./mailserver --add-to-white-list 192.0.2.0/24,192.0.2.3/16 |
|
|
Removes one or more subnet masks from the mail server white list. |
To remove 192.0.2.0/24 and 192.0.2.4/16 from the mail server white list: # ./mailserver --remove-from-white-list 192.0.2.0/24,192.0.2.4/16 |
|
|
Updates the Sender Policy Framework (SPF) settings. |
To enable the SPF spam protection on the mail server: # ./mailserver --update-spf -spf-status true |
|
|
Allows/Prohibits using DomainKeys Spam protection to sign outgoing mail. Is Available since Plesk 8.4. |
To enable signing on outgoing mail on the mail server: # ./mailserver --sign-outgoing-mail true |
|
|
Allows/Prohibits using DomainKeys Spam protection to verify incoming mail. Is Available since Plesk 8.4. |
To enable verifying incoming mail on the mail server: # ./mailserver --verify-incoming-mail true |
|
|
Displays mail server settings. The following modes are available:
|
To view the SPF settings: # ./mailserver --info spf or # ./mailserver -i spf |
|
|
Displays help on the use of the utility. |
To view the help on the use of the # ./mailserver --help or # ./mailserver -h |
Options
Option |
Parameter |
Description |
Example |
|
|---|---|---|---|---|
|
|
Specifies mail user authorization type during mail relaying. |
To set the relaying mode to authorization is required mode, to specify the both authorization type, and set the lock time to 10 min: # ./mailserver --set-relay auth -auth-type both -lock-time 10 |
|
|
|
Specifies the lock time for POP3 authorization. Required with |
See Example above. |
|
|
|
Enables/Disables the Sender Policy Framework (SPF) spam protection on the mail server. Used only with the |
To enable the SPF spam protection on the mail server: # ./mailserver --update-spf -spf-status true |
|
|
|
Sets the SPF behavior. The following modes are available:
Used only with the |
To set SPF behavior to reject mails when SPF resolves to "fail": # ./mailserver --update-spf -spf-behavior 3 |
|
|
|
Sets SPF rules that will be applied for domains which do not conform to the SPF policies. 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". 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. Used only with the |
To set the SPF explanation text to "You message does not conform to the SPF policies": # ./mailserver --update-spf -spf-exp "You message does not conform to the SPF policies" |
|