mailserver: Mail Server Settings
The mailserver
utility is used to manage Plesk mail server settings.
By 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 accepted by the mail server
- enabling, disabling, and configuring spam protection service
- enabling, disabling, and configuring outgoing mail control service
- setting the IP address for outgoing mail
- managing mail server black and white lists
Usage
mailserver <command> [
<option_1> [<param>]
[<option_2> [<param>]]
... [<option_N> [<param>]]
]
Example
The following command sets the relaying mode that requires authorization, specifies the SMTP authorization type for mail users, and set the lock time to 10 minutes:
plesk bin mailserver --set-relay auth -auth-type smtp -lock-time 10
Commands
Command | Parameter | Description | Example |
---|---|---|---|
--set-relay |
closed|auth |
Specifies the mail relay mode for the mail server. If parameter |
To set the Plesk mail server relaying mode to “authorization
is required” ( plesk bin mailserver --set-relay auth -auth-type both |
--set-max-letter-size |
<number>[B|K|M|G] |
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: plesk bin mailserver --set-max-letter-size 2M |
--set-max-connections |
<number> |
Limits the number of concurrent connections to the mail server. |
To limit the number of concurrent connections to the mail server to 100: plesk bin mailserver --set-max-connections 100 |
--set-max-connections-per-ip |
<number> |
Limits the number of concurrent connections to the mail server from a single IP address. |
To limit the number of concurrent connections to the mail server from a single IP address to 5: plesk bin mailserver --set-max-connections-per-ip 5 |
--set-maps-status |
true|false |
Enables/Disables MAPS (Mail Abuse Prevention System) spam protection. |
To enable MAPS spam protection on the mail server: plesk bin mailserver --set-maps-status true |
--add-maps-zone |
<zone1>,<zone2>...<zoneN> |
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: plesk bin mailserver --add-maps-zone maps1.example.com,maps2.example.com |
--set-maps-zone |
<zone1>,<zone2>...<zoneN> |
Enables/Disables MAPS spam protection for one or more domain names. |
To enable MAPS spam protection for domain names maps1.example.com and maps2.example.com: plesk bin mailserver --set-maps-zone maps1.example.com,maps2.example.com |
--remove-maps-zone |
<zone1>,<zone2>...<zoneN> |
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: plesk bin 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.
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: plesk bin mailserver --set-account-type both |
--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: plesk bin 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 black list. |
To add domain names example.org and sample.example.com to the black list of mail server: plesk bin mailserver --add-to-black-list example.org,sample.example.com |
--remove-from-black-list |
<domain_name_1>[,<domain_name_2>,...<domain_name_N>] |
Removes one or more domain names from the black list of mail server. |
To remove domain names sample.example.org and forum.example.com from the mail server black list: plesk bin mailserver --remove-from-black-list sample.example.org,forum.example.com |
--add-to-white-list |
<IP address/subnet mask 1>[,<IP address/subnet mask 2>,...<IP address/subnet mask N>] |
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: plesk bin mailserver --add-to-white-list 192.0.2.0/24,10.0.0.0/24 |
--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 white list. |
To remove 192.0.2.0/24 and 192.0.2.4/16 from the mail server white list: plesk bin mailserver --remove-from-white-list 192.0.2.0/24,10.0.0.0/24 |
--set-virusfilter |
none|drweb |
Enables and specifies an antivirus used on the mail server:
Plesk Premium Antivirus for Servers (drweb ), or disables using
antivirus on the mail server (none ). |
To enable Plesk Premium Antivirus for Servers on the mail server: plesk bin mailserver --set-virusfilter drweb |
--update-spf |
Updates the Sender Policy Framework (SPF) settings. Note: SPF cannot be disabled if DMARC spam protection is enabled. |
To enable the SPF spam protection on the mail server: plesk bin mailserver --update-spf -spf-status true |
|
--enable-dmarc |
Enables DMARC spam protection. Note: This command can be used only if DKIM and SPF spam protection are enabled. Otherwise, the error message will be displayed. |
To enable DMARC spam protection for incoming mail on the mail server: plesk bin mailserver --enable-dmarc |
|
--disable-dmarc |
Disables DMARC spam protection. |
To disable DMARC spam protection for incoming mail on the mail server: plesk bin mailserver --disable-dmarc |
|
--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: plesk bin mailserver --set-message-submission true |
--sign-outgoing-mail |
true|false |
Allows/Prohibits using DKIM spam protection method to sign outgoing mail. Is |
To enable signing of outgoing mail on the mail server: plesk bin mailserver --sign-outgoing-mail true |
--verify-incoming-mail |
true|false |
Allows/Prohibits using DKIM spam protection method to verify incoming mail. Is Note: DKIM cannot be disabled for incoming mail if DMARC spam protection is enabled. |
To enable verifying incoming mail on the mail server: plesk bin mailserver --verify-incoming-mail true |
--update-webmail |
roundcube |
Enables/Disables the selected webmail client. Requires the |
To enable Roundcube webmail on the mail server: plesk bin mailserver --update-webmail roundcube -state true |
--info or -i
|
options|black-list|white-list|spf|webmails |
Displays mail server settings. The following modes are available:
|
To view the SPF settings: plesk bin mailserver --info spf or plesk bin mailserver -i spf |
--clean-mail-queue |
Removes the messages in the mail queue. |
To remove the messages in the mail queue: plesk bin mailserver --clean-mail-queue |
|
--add-external-webmail |
Registers an additional (external) webmail service with Plesk so that you can provide your users with access to it. Requires the |
To register the external webmail service ExampleMail at URL mail.example.com: plesk bin 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: plesk bin mailserver --update-external-webmail "ExampleMail" -webmail-url mail2.example.com To change the name for the external webmail service ExampleMail to SampleMail: plesk bin mailserver --update-external-webmail "ExampleMail" -webmail-name "SampleMail" |
--remove-external-webmail |
<service name> |
Removes registration of an additional webmail service. |
To remove the external webmail service record ExampleMail: plesk bin mailserver --remove-external-webmail "ExampleMail" |
--update-smtp-settings |
Updates the settings of an external SMTP server for outgoing mail. Note that to use an external SMTP server, you should install a special client through Tools & Settings > Updates > Mail hosting features > Different mail servers. |
To update the external SMTP server settings: plesk bin mailserver --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: plesk bin 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: plesk bin mailserver --disable-outgoing-antispam |
|
--set-outgoing-messages-mbox-limit |
<number> |
Sets the maximum number of outgoing messages from a mailbox (per hour) that Plesk will use by default. |
To set the default value for the limit on outgoing email messages from an email address: plesk bin mailserver --set-outgoing-messages-mbox-limit 5 |
--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: plesk bin 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: plesk bin mailserver --set-outgoing-messages-subscription-limit 50 |
--set-outgoing-messages-enable-sendmail |
true | false |
Sets the default value (on or off) for Linux sendmail for
PHP scripts. Scripts will be able to send mail even when the
limits on outgoing messages are reached for the corresponding
mailbox and domain. |
To prohibit PHP scripts send outgoing mail from the Plesk server using sendmail: plesk bin mailserver --set-outgoing-messages-enable-sendmail false |
--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: plesk bin 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: plesk bin mailserver --set-outgoing-messages-notification-period PT6H |
--set-outgoing-email-mode |
domain_ip|domain-name|<explicit IP address> |
If you use Postfix, you can set outgoing mail mode, which means
IP addresses that Plesk uses to send mail from. By default,
mail from each domain is sent using the domain’s IP address
(the If domain IP addresses are used to send mail, you can make
Plesk use the domain names in SMTP greeting, by using the
If you need Plesk to send all mail from one IP address, use
|
To make Plesk use domain names in SMTP greetings: plesk bin mailserver --set-outgoing-email-mode domain-name To make Plesk send all mail from the IP address 10.0.0.1: plesk bin mailserver --set-outgoing-email-mode explicit-ip -explicit-ipv4 10.0.0.1 |
--set-certificate |
<certificate name> |
Specifies the name of the SSL/TLS certificate used to secure the mail server. |
To secure the mail server with the SSL/TLS certificate cert3 that is stored in the repository of the domain example.com: plesk bin mailserver --set-certificate "cert3" -certificate-repository example.com |
--email-subaddressing-enable |
true|false |
Enables or disables the ability to configure VERP-style email addresses for mailing lists on a Plesk server. By default, VERP-style email addresses for mailing lists are enabled. |
To enable VERP-style email addresses for mailing lists: plesk bin mailserver --email-subaddressing-enable true |
--set-mail-autodiscover |
true|false |
Enables or disables mail autodiscover on a Plesk server. By default, mail autodiscover is enabled. |
To enable mail autodiscover on a Plesk server: plesk bin mailserver --set-mail-autodiscover true |
--set-mail-autodiscover-domain-name |
<domain> |
Specifies a custom domain name for mail autodiscover on a Plesk server. By default, no custom domain name is specified. Works for new domains only. To apply a custom domain name to both new and already existing domains,
use the command with the |
To specify the custom domain name plesk bin mailserver --set-mail-autodiscover-domain-name example.com |
--quota-warning-enable |
true|false |
Enables or disables the mailbox quota warning feature on a Plesk server. By default, the feature is enabled. When it is, mail users receive email notifications when more than 95% of their mailbox disk space is occupied. |
To enable mailbox quota warnings: plesk bin mailserver --quota-warning-enable true |
--set-outgoing-messages-fix-sender |
true|false |
Enables or disables the fixing of an incorrectly set sender. If enabled, it reduces the chances of mail being treated as spam. The feature automatically sets valid email headers and sender envelope addresses for outgoing mail from domains in Plesk. By default, the feature is disabled. |
To enable the fixing of an incorrectly set sender: plesk bin mailserver --set-outgoing-messages-fix-sender true |
--help or -h
|
Displays help on the use of the utility. |
To view the help on the use of the plesk bin mailserver --help or plesk bin mailserver -h |
|
--set-outgoing-messages-count-recipients |
true|false |
Enables or disables counting of outgoing mail by recepients instead of outgoing messages. This helps to avoid exceeding the limits. Note that this feature does not affect sending messages using mailing lists. By default, the feature is disabled. |
To make Outgoing Mail Control count outgoing email messages by recepients: plesk bin mailserver --set-outgoing-messages-count-recipients true |
--add-extra-auto-reply-header |
<header1_name>:<header1_value>,<header2_name>:<header2_value>,...<headerN_name>:<headerN_value> |
Adds an extra email header to all auto-reply email messages that will be sent from the Plesk server. |
To add the Precedence header: plesk bin mailserver --add-extra-auto-reply-header <Precedence>:<Bulk> |
--remove-extra-auto-reply-header |
<header1_name>,<header2_name>,...<headerN_name> |
Removes an extra email header from all auto-reply email messages that will be sent from the Plesk server. |
To remove the X-Auto-Response-Suppress header: plesk bin mailserver --remove-extra-auto-reply-header <X-Auto-Response-Suppress> |
--configure-smarthost |
smarthost-host|smarthost-port|smarthost-user|smarthost-encryption |
Configures a smarthost. Requires the -smarthost-host , -smarthost-port , -smarthost-user , and -smarthost-encryption options. |
To configure the server to send mail via the example.com smarthost with no authentication and with encryption enabled: plesk bin mailserver --configure-smarthost -smarthost-host example.com -smarthost-port 25 -smarthost-user "" -smarthost-encryption on |
--enable-smarthost |
Enables the previously-configured smarthost. |
To enable a previously-configured smarthost: plesk bin mailserver --enable-smarthost |
|
--disable-smarthost |
Disables the previously-configured smarthost. |
To disable a previously-configured smarthost: plesk bin mailserver --disable-smarthost |
Options
Option | Parameter | Description | Example |
---|---|---|---|
-auth-type |
pop3|smtp|both |
Specifies mail user authorization type during mail relaying. Used with the |
To set the relaying mode to authorization is required mode, to specify the both authorization type, and set the lock time to 10 min: plesk bin mailserver --set-relay auth -auth-type both -lock-time 10 |
-lock-time |
<minutes> |
Specifies the lock time for POP3 authorization. Required with |
See Example above. |
-spf-status |
true|false |
Enables/Disables the Sender Policy Framework (SPF) spam protection on the mail server. Used only with the Note: SPF cannot be disabled if DMARC spam protection is enabled. |
To enable the SPF spam protection on the mail server: plesk bin mailserver --update-spf -spf-status true |
-spf-behavior |
true|false<number> |
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”: plesk bin mailserver --update-spf -spf-behavior 3 |
-spf-rules |
<string> |
Sets SPF rules that will be applied if SPF checks return “fail”, “softfail”, or “neutral”. Enables/Disables the Sender Policy Framework (SPF) spam protection on the mail server. Used only with the |
To set the following SPF rule - “include:spf.trusted-forwarder.org”: plesk bin mailserver --update-spf -spf-rules "include:spf.trusted-forwarder.org" |
-spf-guess |
<string> |
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 - “iv=spf1 +a/24 +mx/24 +ptr ?all”: plesk bin mailserver --update-spf -spf-guess "v=spf1 +a/24 +mx/24 +ptr ?all" |
-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. Used only with the |
To set the SPF explanation text to “You message does not conform to the SPF policies”: plesk bin mailserver --update-spf -spf-exp "You message does not conform to the SPF policies" |
-spf-ignore-dns-error |
true|false |
Specifies whether SPF checking should continue or stop when there are DNS lookup problems on the mail server. Used only with the |
To continue SPF checking when there are DNS lookup problems on the mail server: plesk bin mailserver --update-spf -spf-status true -spf-ignore-dns-error true |
-state |
true|false |
Enables/Disables the selected webmail client. Required for the |
To enable Atmail webmail on the mail server: plesk bin mailserver --update-webmail atmail -state true |
-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: plesk bin mailserver --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: plesk bin mailserver --update-external-webmail "ExampleMail" -webmail-status disabled |
-explicit-ipv4 |
<IPv4 address> | Specifies the IPv4 address from which Plesk will send all mail. |
To make Plesk send all mail from the IP address 10.0.0.1 plesk bin mailserver --set-outgoing-email-mode explicit-ip -explicit-ipv4 10.0.0.1 |
-explicit-ipv6 |
<IPv6 address> | Specifies the IPv6 address from which Plesk will send all mail. | |
-smtp-host |
<domain|IP address> |
Sets the host name or IP address of the external SMTP server for outgoing mail. |
To update the external SMTP server settings: plesk bin mailserver --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. | |
-certificate-repository |
<domain-name> |
Specifies the domain of the SSL/TLS certificate repository. By default, the server repository is used. This option is used with the command |
To secure the mail server with the SSL/TLS certificate cert3 stored in the repository of the domain example.com: plesk bin mailserver --set-certificate "cert3" -certificate-repository example.com |
-reconfigure-dns |
true|false |
Applies a custom domain name for mail autodiscover to already existing domains. Used with the |
To specify the custom domain name plesk bin mailserver --set-mail-autodiscover-domain-name example.com -reconfigure-dns true |
-smarthost-host |
ip|hostname |
Sets the smarthost hostname or IP address. Used only with the |
|
-smarthost-port |
<number> |
Sets the port number the server uses to connect to the smarthost. Used only with the |
|
-smarthost-user |
<username> |
Sets the username the server uses to connect to the smarthost. Used only with the
|
|
-smarthost-encryption |
on|off |
Sets whether the server uses encryption to connect to the smarthost. Used only with the |