Mail Server Settings: mailserver Utility

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

--set-relay

closed | auth

Sets the relaying mode for the mail server (the Relaying parameter).

  • closed - the closed option
  • auth - the authorization is required option

Set to closed by default.

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

 

--set-max-letter-size

<number>[K|M|G]

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

--set-maps-status

true | false

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

--add-maps-zone

<domain name 1>[,<domain name 2>, ... <domain name N>]

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

--remove-maps-zone

<domain name 1>[,<domain name 2>, ... <domain name N>]

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

--set-account-type

full | both

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).

  • full - only login names in the <user@example.com> (the "full" format) are allowed
  • both - login names in both <user> (the "short" format) and <user@example.com> (the "full" format) are allowed

Is set to full by default.

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

--use-vocabulary

true | false

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

--add-to-black-list

<domain name 1>[,<domain name 2>, ... <domain name N>]

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

--remove-from-black-list

<domain name 1>[,<domain name 2>, ... <domain name N>]

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

--add-to-white-list

<IP address/subnet mask 1>[,<IP address/subnet mask 2>, ... <IP address/subnet mask N>]

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

--remove-from-white-list

<IP address/subnet mask 1>[,<IP address/subnet mask 2>, ... <IP address/subnet mask N>]

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

--update-spf

 

Updates the SPF (Sender Policy Framework) settings.

To enable the SPF spam protection on the mail server:

# ./mailserver --update-spf -spf-status true

--info or -i

options | black-list | white-list | spf

Displays mail server settings:

  • options - displays various mail server settings except for the mail server black and white lists contents and the the SPF (Sender Policy Framework) settings.
  • black-list - displays the mail server black list content
  • white-list - displays the mail server white list content
  • spf - displays the SPF (Sender Policy Framework) settings.

To display the SPF (Sender Policy Framework) settings:

# ./mailserver --info spf

or

# ./mailserver -i spf

--help or -h

 

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

-auth-type

pop3|smtp|both

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

 

-lock-time

<number>

Sets the lock time for POP3 authorization (in minutes).

Required for pop3 and both authorization types.

-spf-status

true|false

Enables or disables the SPF (Sender Policy Framework) spam protection on the mail server.

Used only with the --update-spf command.

To enable the SPF (Sender Policy Framework) spam protection on the mail server:

# ./mailserver --update-spf -spf-status true

-spf-behavior

<number>

Sets the SPF behavior (the SPF checking mode parameter).

1 - Only create Received-SPF headers, never block

2 - Use temporary error notices when you have DNS lookup problems

3 - Reject mails when SPF resolves to "fail" (deny)

4 - Reject mails when SPF resolves to "softfail"

5 - Reject mails when SPF resolves to "neutral"

6 - Reject mails when SPF does not resolve to "pass"

Used only with the --update-spf command.

To set SPF behavior to Reject mails when SPF resolves to "fail" (deny):

# ./mailserver --update-spf -spf-behavior 3

-spf-rules

<string>

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 --update-spf command.

To set the following SPF rule include:spf.trusted-forwarder.org:

# ./mailserver --update-spf -spf-rules "include:spf.trusted-forwarder.org"

-spf-guess

<string>

Sets SPF rules that will be applied if SPF checks return "fail", "softfail", or "neutral" (the SPF guess parameter).

Used only with the --update-spf command.

To set the following SPF rule include:spf.trusted-forwarder.org:

# ./mailserver --update-spf -spf-guess "include:spf.trusted-forwarder.org"

-spf-exp

<string>

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 --update-spf command.

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"