mailserver.exe: Mail Server Options

The mailserver.exe serves to change server-wide mail settings defining the way mail server works on all domains where the mail service is enabled. Using this utility, you can perform the following tasks:

  • Setting the relaying mode for the mail server.
  • Setting the maximum message size that can be sent through the mail server.
Location

%plesk_cli%

Usage
mailserver.exe <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.exe --set-relay auth -auth-type pop3 -lock-time 10

Commands
Command Parameter Description Example

--set-relay

closed|auth

Specifies the mail relay mode for the mail server.

If parameter auth is used, requires the -auth-type opion.

To make mail server work in the closed relay mode:

mailserver.exe --set-relay closed

--set-max-letter-size

<number>[K|M|G]

Limits the maximum message size that can be sent through the mail server.

To restrict the maximum message size that can be accepted by the mail server to 5 Mbytes:

mailserver.exe --set-max-letter-size 5M

--set-maps-status

true|false

Enables/Disables DNSBL spam protection.

Before you enable the protection, you should set the list of RBL hosts with the --set-maps-zone or --add-maps-zone command.

To enable DNSBL spam protection on the mail server:

mailserver.exe --set-maps-status true

--add-maps-zone

<domain_name_1>[,<domain_name_2>,...<domain_name_N>]

Adds one or more domain names to the existing DNSBL spam protection list.

To enable the spam protection, use the --set-maps-status command.

To add domain names maps1.example.com and maps2.example.com to the DNSBL spam protection list:

mailserver.exe --add-maps-zone maps1.example.com,maps2.example.com

--set-maps-zone

<domain_name_1>[,<domain_name_2>,...<domain_name_N>]

Sets a new DNSBL spam protection list and adds the specified domains to it.

This command removes the previously existing list.

To enable the spam protection, use the --set-maps-status command.

To set a new DNSBL spam protection list and add domain names maps1.example.com and maps2.example.com to the list:

mailserver.exe --set-maps-zone maps1.example.com,maps2.example.com

--remove-maps-zone

<domain_name_1>[,<domain_name_2>,...<domain_name_N>]

Removes one or more domain names from the DNSBL spam protection list.

To remove domain names maps1.example.com and maps2.example.com from the DNSBL spam protection list:

>mailserver --remove-maps-zone maps1.example.com,maps2.example.com

--use-vocabulary

true|false

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.exe --use-vocabulary true

--add-to-black-list

<domain_name_1>|<email_address_1> [,<domain_name_2>|<email_address_2>,...<domain_name_N>|<email_address_N>]

Adds a list of addresses to the server black list.

Both e-mail addresses and domains can be specified. Wildcards (? and *) are allowed.

Separate entries with comma, for example: mail@example.com, spam?@spamdomain?.*, *domain.com

To add domain names example.org, sample.example.net and the addresses matching the mask *spam@google.com to the black list of the mail server:

mailserver.exe --add-to-black-list example.org,sample.example.net,*spam@google.com -action mark_spam

--remove-from-black-list

<domain_name_1>|<email_address_1> [,<domain_name_2>|<email_address_2>,...<domain_name_N>|<email_address_N>]

Removes a list of addresses from the server black list.

Both e-mail addresses and domains can be specified. Wildcards (? and *) are allowed.

Separate entries with comma, for example: mail@example.com, spam?@spamdomain?.*, *domain.com

To remove domain names sample.example.org, forum.example.net and the addresses matching the mask *spam@google.com from the mail server black list:

mailserver.exe --remove-from-black-list sample.example.org,forum.example.net,*spam@google.com

--add-to-white-list

<domain_name_1>|<email_address_1>|<IP address/subnet mask 1> [,<domain_name_2>|<email_address_2>|<IP address/subnet mask _2>,...<domain_name_N>|<email_address_N>|<IP address/subnet mask_N>]

Adds a list of addresses to the server white list.

IP addresses with masks, e-mail addresses, or domains can be specified. Wildcards (? and *) are allowed.

Separate entries with comma, for example: mail@example.com, notspam?@notspamdomain?.*, *domain.com, 123.123.123.123/32

To add 192.0.2.0/24 and 192.0.2.3/16 and the addresses matching the mask *@plesk.com to the mail server white list:

mailserver.exe --add-to-white-list 192.0.2.0/24,10.0.0.0/24,*@plesk.com

--remove-from-white-list

<domain_name_1>|<email_address_1>|<IP address/subnet mask 1> [,<domain_name_2>|<email_address_2>|<IP address/subnet mask _2>,...<domain_name_N>|<email_address_N>|<IP address/subnet mask_N>]

Removes a list of addresses from the server white list.

IP addresses with masks, e-mail addresses, or domains can be specified. Wildcards (? and *) are allowed.

Separate entries with comma, for example: mail@example.com, notspam?@notspamdomain?.*, *domain.com, 123.123.123.123/32.

To remove 192.0.2.0/24 and 192.0.2.4/16 and the addresses matching the mask *@plesk.com from the mail server white list:

mailserver.exe --remove-from-white-list 192.0.2.0/24,10.0.0.0/24,*@plesk.com

--update-virusfilter

 

Specifies antivirus scanning settings.

Requires the -server-wide or -allow-personal option.

To switch on server-wide antivirus scanning for incoming mail:

mailserver.exe --update-virusfilter -server-wide in

--set-message-submission

true|false

Defines whether the mail messages sent through the server are submitted or not.

To enable message submission on all IP addresses:

>mailserver --set-message-submission true

--sign-outgoing-mail

true|false

Allows/Prohibits using DomainKeys Spam protection to sign outgoing mail.

Is false by default.

To enable signing on outgoing mail on the mail server:

>mailserver --sign-outgoing-mail true

--verify-incoming-mail

true|false

Allows/Prohibits using DomainKeys Spam protection to verify incoming mail.

Is false by default.

To enable verifying incoming mail on the mail server:

>mailserver --verify-incoming-mail true

--update-webmail

horde|mewebmail

Specifies the webmail client you want to enable or disable..

To enable Horde webmail on the mail server:

>mailserver --update-webmail horde -state true

--info or -i

options|black-list|white-list

Displays mail server settings. The following modes are available:

  • options - displays various mail server settings except for the mail server black and white lists contents.
  • black-list - displays the mail server black list content.
  • white-list - displays the mail server white list content.

To view the mail server options:

>mailserver --info options

or

>mailserver -i options

--add-external-webmail

-webmail-name <service name> -webmail-url <URL for access to the service>

Registers an additional (external) webmail service with Plesk so that you can provide your users with access to it.

To learn more about registering additional webmail services with Plesk, refer to Administrator's Guide > Webmail Software.

To register an external webmail service called ExampleMail at URL mail.example.com:

>mailserver --add-external-webmail -webmail-name ExampleMail -webmail-url mail.example.com

--update-external-webmail

<service name>

Updates information about an additional webmail service.

To change the URL for the webmail record ExampleMail to mail2.example.com:

>mailserver --update-external-webmail "ExampleMail" -webmail-url mail2.example.com

To change the name for the external webmail service ExampleMail to SampleMail:

>mailserver --update-external-webmail "ExampleMail" -webmail-name "SampleMail"

 

--remove-external-webmail

<service name>

Unregisters an additional webmail service.

To remove the external webmail service record ExampleMail:

>mailserver --remove-external-webmail "ExampleMail"

--update-smtp-settings

 

Updates the settings of an external SMTP server for outgoing mail.

To update the external SMTP server settings:

mailserver.exe --update-smtp-settings -mail-notifications true -smtp-host 123.123.123.123 -smtp-port 587 -smtp-login jdoe -smtp-password sample -smtp-tls true -smtp-allow-users true

--enable-outgoing-antispam

 

Switches on limits on outgoing email messages.

To turn on the usage of limitations on outgoing mail from the Plesk server:

>mailserver --enable-outgoing-antispam

--disable-outgoing-antispam

 

Switches off limits on outgoing email messages.

To turn off the usage of limitations on outgoing mail from the Plesk server:

>mailserver --disable-outgoing-antispam

--set-outgoing-messages-domain-limit

<number>

Sets the maximum number of outgoing messages from a domain (per hour) that Plesk will use by default.

To set the default value for the limit on outgoing email messages from a domain:

>mailserver --set-outgoing-messages-domain-limit 10

--set-outgoing-messages-subscription-limit

<number>

Sets the maximum number of outgoing messages from a subscription (per hour) that Plesk will use by default.

To set the default value for the limit on outgoing email messages from a subscription:

>mailserver --set-outgoing-messages-subscription-limit 50

--set-outgoing-messages-report-period

<P1D|P1W|P2W|P1M>

Sets the default period of time for the alert on the Plesk Home page about attempts to exceed limits on outgoing mail (the last day, week, two weeks, or month).

To make Plesk calculate reports on outgoing mail using the data for the last two weeks:

>mailserver --set-outgoing-messages-report-period P2W

--set-outgoing-messages-notification-period

<PT15M|PT1H|PT6H|PT12H|P1D>

Sets the default period of time for email notifications about attempts to exceed limits on outgoing mail (15 minutes, 1 hour, 6 hours, 12 hours,1 day).

To make Plesk send notifications to administrator on outgoing mail every 6 hours:

>mailserver --set-outgoing-messages-notification-period PT6H

--help or -h

 

Displays help on the use of the utility.

To view the help on the use of the mailserver utility:

>mailserver --help

or

>mailserver -h

Note: When enabling checking passwords in a dictionary, be sure that Microsoft Windows Local Security Policy is set up as follows: Security settings > Account polices > Password policy: Password must meet complexity requirements is Enabled.

Options
Option Parameter Description Example

-auth-type

pop3|smtp|both

Specifies mail user authorization type during mail relaying.

Used with the --set-relay command only.

To set the relaying mode with POP3 authorization with the lock time equal to 10 minutes:

mailserver.exe --set-relay auth -auth-type pop3 -lock-time 10

-lock-time

<minutes>

Specifies the lock time for POP3 authorization.

Required with -auth-type option when the pop3 or both parameter is set.

See the example for -auth-type.

-state

true|false

Enables (true) or disables (false) the specified webmail client.

Used with the --update-webmail command.

To enable Horde webmail on the mail server:

mailserver.exe --update-webmail horde -state true

-action

delete|mark_spam

Specifies the action for mail messages matching the specified address pattern – whether to delete the messages or to mark them as spam.

Wildcards (? and *) are allowed for specifying addresses.

Required for the --add-to-black-list command.

To delete messages coming from spam@mail.com and *@spam.com:

mailserver.exe --add-to-black-list spam@mail.com,*@spam.com -action delete

-submission-ip

<ip>

Specifies IP address for message submission.

Used with the --set-message-submission command only.

To enable message submission on IP address 192.0.2.10:

mailserver.exe --set-message-submission true -submission-ip 192.0.2.10

-server-wide

none|in|out|both

Sets server-wide antivirus scanning policy:

  • none - switches off antivirus scanning.
  • in - switches on scanning of incoming mail.
  • out - switches on scanning of outgoing mail.
  • both - switches on scanning of both incoming and outgoing mail.

 

Used with the --update-virusfilter command.

To switch on server-wide antivirus scanning for incoming and outgoing mail:

mailserver.exe --update-virusfilter -server-wide both

-allow-personal

none|in|out|both

Allows to override server-wide antivirus scanning policy for separate mail accounts:

  • none - switches off antivirus scanning for separate mail accounts.
  • in - switches on scanning of incoming mail for separate mail accounts.
  • out - switches on scanning of outgoing mail for separate mail accounts.
  • both - switches on scanning of both incoming and outgoing mail for separate mail accounts.

 

Used with the --update-virusfilter command.

To switch off antivirus scanning for outgoing mail for separate mail accounts:

mailserver.exe --update-virusfilter -allow-personal out

-excluded-nets

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

Sets networks that should be excluded from relay restrictions.

Used with the --set-relay command.

To make mail server work in the closed relay mode with the exception of 212.45.62.0/24:

mailserver.exe --set-relay closed -excluded-nets 212.45.62.0/24

-webmail-name

<service name>

Specifies the name for an external webmail service.

To register an external webmail service called ExampleMail at URL mail.example.com:

mailserver.exe --add-external-webmail -webmail-name ExampleMail -webmail-url mail.example.com

-webmail-url

<URL for access to the service>

Specifies the URL for an external webmail service.

-webmail-status

enabled|disabled

Specifies whether the additional (external) webmail is available for selection in hosting plans.

To temporarily remove the ExampleMail webmail option from hosting plans:

mailserver.exe --update-external-webmail "ExampleMail" -webmail-status disabled

-smtp-use-default-settings

true|false

Uses the mail server installed with Plesk as an external SMTP server, and uses the default mail account to access this SMTP server.

Use this option with the --update-smtp-settings command.

If you set this option to false, then you should specify the settings of an external SMTP server (see the options below.)

To use the mail server installed with Plesk and a default mail account created by Plesk for accessing mail server for outgoing mail:

mailserver.exe --update-smtp-settings -smtp-use-default-settings true

-smtp-host

<domain|ip>

Sets the host name or IP address of the external SMTP server for outgoing mail.

To update the external SMTP server settings in order to use the SMTP server other than installed in Plesk:

mailserver.exe --update-smtp-settings -mail-notifications true -smtp-host 123.123.123.123 -smtp-port 587 -smtp-login jdoe -smtp-password sample -smtp-tls true -smtp-allow-users true

-smtp-port

<port>

Sets the port for the external SMTP server for outgoing mail.

-smtp-login

<login_name>

Sets the username for accessing the external SMTP server for outgoing mail.

-smtp-password

<pasword>

Sets the password for accessing the external SMTP server for outgoing mail.

-mail-notifications

true|false

Allows Plesk to send email notifications through the specified SMTP server.

-smtp-tls

true|false

Specifies whether the external SMTP server requires encrypted connections.

-smtp-allow-users

true|false

Allows users' scripts to send mail through the external SMTP server.

 

Leave your comments on this page

Leave your feedback or question on this documentation topic below. For technical assistance, contact your hosting service provider or submit a request to Plesk support. Suggest new features for Plesk here. Discuss general questions on the Plesk forum. All offtopic comments will be removed.