Use the CLI commands in this topic to configure the mail server that sends health check notifications. See System mail server settings for a description of each parameter.
Note
See Configuring email recipients using the CLI for information about configuring the notification recipients. See Configuring system event notifications using the CLI for information about configuring the events that trigger notifications.
Go to CLI configuration mode:
hostname > enable hostname # configure terminal
Specify the hostname or IP address of the mail server:
hostname (config) # email mailhub {<hostname> | <IPv4 or IPv6 address>}Specify the SMTP port used by the mail server to send notifications:
hostname (config) # email mailhub-port <port>Specify the domain name from which emails will appear to come:
hostname (config) # email domain <domainName>Specify the username or fully qualified return address from which emails are sent:
hostname (config) # email return-addr {<username> | <returnAddress>}(Optional) Include the hostname of the mail server in the return address:
hostname (config) # email return-hostVerify your changes:
hostname (config) # show emailSave your changes:
hostname (config) # write memory
Note
To remove a configuration or restore a default setting, append no to the command. For example, to exclude the hostname in the return address, use the no email return-host command, and to restore the default domain name, use the no email domain command.
Examples
In this example, the return address is not fully qualified, so the hostname ("hostname") and domain are appended to it.
hostname (config) # email mailhub 10.1.0.0 hostname (config) # email domain mail.acme.com hostname (config) # email return-addr admin hostname (config) # show email Mail hub: 10.1.0.0 Mail hub port: 25 Domain override: mail.acme.com Return address: admin Include hostname in return address: yes Current reply address: admin@hostname.mail.acme.com ...
In this example, the return address is fully qualified, so the hostname and domain are not included.
hostname (config) # email mailhub 10.1.0.0 hostname (config) # email domain mail.acme.com hostname (config) # email return-addr notify@acme.com hostname (config) # show email Mail hub: 10.2.0.0 Mail hub port: 25 Domain override: mail.acme.com Return address: notify@acme.com Include hostname in return address: yes Current reply address: notify@acme.com ...
In this example, all settings are restored to their default values.
hostname (config) # show email Mail hub: 10.3.0.0 Mail hub port: 26 Domain override: mailhost.acme.com Return address: admin Include hostname in return address: no Current reply address: admin@hostname.mailhost.acme.com ... hostname (config) # no email mailhub hostname (config) # no email mailhub-port hostname (config) # no email return-addr hostname (config) # email return-host hostname (config) # show email Mail hub: Mail hub port: 25 Domain override: Return address: do-not-reply Include hostname in return address: yes Current reply address: do-not-reply@hostname.acme.com ...