- Table of Contents
-
- 20-Network Management and Monitoring Command Reference
- 00-Preface
- 01-Ping and tracert commands
- 02-System debugging commands
- 03-NQA commands
- 04-SNMP commands
- 05-RMON commands
- 06-NETCONF commands
- 07-Process monitoring and maintenance commands
- 08-Mirroring commands
- 09-Email Notification Service Commands
- 10-UCC commands
- 11-SQA commands
- 12-Packet capture commands
- Related Documents
-
Title | Size | Download |
---|---|---|
09-Email Notification Service Commands | 88.28 KB |
Email notification service commands
display mail-server
Use display mail-server to display configuration information for an email notification service.
Syntax
display mail-server [ name server-name ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
name server-name: Specifies an email notification service. You can only specify a service that has been created on the device. If you do not specify this option, this command displays configuration information for all email notification services.
Examples
# Display configuration information about all email notification services.
<Sysname> display mail-server
Server name: mail-server
IPv4 address: 1.1.1.1
Port number: 7025
Mail server username: [email protected]
SSL-policy: ssl-test
Mail subject: Alert-Log
Mail sender: [email protected]
Mail recipients: [email protected];[email protected]
Mail copyto: [email protected]
Mail encrypt mode: ssl
Mail send success: 0
Mail send failed: 0
Server name: test1
IPv4 address: 1.1.1.1
Port number: 25
Mail encrypt mode: none
Mail send success: 0
Mail send failed: 0
Table 1 Command output
Field |
Description |
Server name |
Name of the email notification service |
Domain name |
Domain name of the email server |
IPv4 address |
IPv4 address of the email server |
IPv6 address |
IPv6 address of the email server |
Port number |
Port number of the email server |
Mail server username |
Username for accessing the email server |
SSL-policy |
SSL client policy for the email notification service |
Mail subject |
Email subject of the email notification service |
Mail sender |
Sender email address of the email notification service |
Mail recipients |
Recipient email addresses of the email notification service |
Mail copyto |
CC email addresses of the email notification service |
Mail send success |
Number of emails sent successfully from the server |
Mail send failed |
Number of emails the server failed to send. |
mail-recipients
Use mail-recipients to specify the recipient email addresses.
Use undo mail-recipients to remove the recipient email addresses.
Syntax
mail-recipients mail-address&<1-4>
undo mail-recipients [ mail-address&<1-4> ]
Default
No recipient email addresses are configured.
Views
Email notification service view
Predefined user roles
network-admin
Parameters
mail-address&<1-4>: Specifies a space-separated list of up to four recipient email addresses. Each recipient email address is a case-sensitive string of 1 to 63 characters.
Examples
# Specify [email protected] and [email protected] as the recipient email addresses.
<Sysname> system-view
[Sysname] mail-server aaa
[mail-server-aaa] mail-recipients [email protected] [email protected]
mail-recipients cc
Use mail-recipients to specify the CC email addresses.
Use undo mail-recipients to remove the CC email addresses.
Syntax
mail-recipients cc cc-mail-address&<1-4>
undo mail-recipients cc cc-mail-address&<1-4>
Default
No CC email addresses are configured.
Views
Email notification service view
Predefined user roles
network-admin
Parameters
cc-mail-address&<1-4>: Specifies a space-separated list of up to four CC email addresses. Each CC email address is a case-sensitive string of 1 to 63 characters.
Examples
# Specify [email protected] and [email protected] as the CC email addresses.
<Sysname> system-view
[Sysname] mail-server aaa
[mail-server-aaa] mail-recipients [email protected] [email protected]
mail-sender
Use mail-sender to specify the sender email address.
Use undo mail-sender to restore the default.
Syntax
mail-sender mail-address
undo mail-sender
Default
No sender email address is configured.
Views
Email notification service view
Predefined user roles
network-admin
Parameters
mail-address: Specifies the sender email address. The mail-address argument is a case-sensitive string of 1 to 63 characters.
Usage guidelines
If you execute this command multiple times, the most recent configuration takes effect.
Examples
# Specify [email protected] as the sender email address.
<Sysname> system-view
[Sysname] mail server aaa
[mail-server-aaa] mail-sender [email protected]
mail-server
Use mail-server to create an email notification service and enter its view, or enter the view of the existing email notification service.
Use undo mail-server to remove the email notification service.
Syntax
mail-server server-name
undo mail-server server-name
Default
No email notification service is configured.
Views
System view
Predefined user roles
network-admin
Parameters
server-name: Specifies an email notification service. The service name is a case-sensitive string of 1 to 63 characters.
Examples
# Create email notification service mtp-server1 and enter its view.
<Sysname> system-view
[Sysname] mail-server smtp-server1
[Sysname-mail-server-smtp-server1]
mail-server encrypt-mode
Use mail-server encrypt-mode to specify the encryption method for data transmission between the device and email server.
Use undo mail-server encrypt-mode to restore the default.
Syntax
mail-server encrypt-mode { ssl | starttls }
undo mail-server encrypt-mode
Default
No encryption is used for data transmission between the device and email server.
Views
Email notification service view
Predefined user roles
network-admin
Parameters
ssl: Specifies SSL encryption.
starttls: Specifies STARTTLS encryption.
Usage guidelines
The encryption methods for data transmission between the device and email server include:
· Without encryption—Packets transmitted between the client and server are not encrypted. This method is vulnerable to security risks.
· STARTTLS encryption—Data is encrypted only after the connection between the client and server is established. Packets transmitted during the connection establishment process are not encrypted. After the connection is established, STARTTLS uses SSL or TLS to encrypt data.
· SSL encryption—All packets transmitted between the client and server are encrypted. It is a strong encryption method.
After the SSL encryption method is configured, the device acts as the SSL client for data transmission. You must configure an SSL client policy for the device. For information and configuration about SSL, see SSL configuration in Security Configuration Guide.
Examples
# Specify SSL encryption for the emails sent from the device to the email server.
<Sysname> system-view
[Sysname] mail-server smtp-server1
[Sysname-mail-server-smtp-server1] mail-server encrypt-mode ssl
mail-server host
Use mail-server host to specify the email server.
Use undo mail-server host to restore the default.
Syntax
mail-server host { domain domain-name | ipv4 ip-address | ipv6 ipv6-address } [ port port ] [ ssl-client-policy policy-name ]
undo mail-server host
Default
No email server is specified.
Views
Email notification service view
Predefined user roles
network-admin
Parameters
domain domain-name: Specifies the email server by its domain name. The domain-name argument is a dot-separated, case-insensitive string of a maximum of 253 characters that can contain letters, digits, hyphens (-), underscores (_), and dots (.). Each dot-separated string can contain a maximum of 63 characters.
ipv4 ipv4-address: Specifies the email server by its IPv4 address.
ipv6 ipv6-address: Specifies the email server by its IPv6 address.
port port: Specifies the service port number for the email server, in the range of 1 to 65535. The default value is 25. The value must be consistent with that configured on the email server.
ssl-client-policy policy-name: Specifies the SSL client policy associated with the email server. The policy-name argument is a case-sensitive string of 1 to 31 characters.
Usage guidelines
If the specified email server uses a domain name, you must configure a DNS service to translate the domain name into an IP address. For more information about DNS, see DNS configuration in Network Connectivity Configuration Guide.
Examples
# Specify the email server at 192.168.1.1 for email notification service smtp-server1.
<Sysname> system-view
[Sysname] mail-server smtp-server1
[Sysname-mail-server-smtp-server1] mail-server host ipv4 192.168.1.1
Related commands
dns server (DNS commands in Network Connectivity Command Reference)
mail-server test
Use mail-server test to test the availability of the email server.
Syntax
mail-server test
Views
Email notification service view
Predefined user roles
network-admin
Usage guidelines
This command sends a test email to test the availability of the email server.
If the email server is available, a message "Email server is available" is returned. If the email server is unavailable, a message "Email server is not available" is returned.
Examples
# Test the availability of the email server.
<Sysname> system-view
[Sysname] mail-server smtp-server1
[Sysname-mail-server-smtp-server1] mail-server test
Email server is available.
mail-server username
Use mail-server username to specify the username and password for accessing the email server.
Use undo mail-server username to restore the default.
Syntax
mail-server username username password { cipher | simple } password
undo mail-server username
Default
No username and password are specified for accessing the email server.
Views
Email notification service view
Predefined user roles
network-admin
Parameters
username: Specifies the username for accessing the email server, a case-sensitive string of 1 to 63 characters. The username cannot these special characters: ampersand (&), vertical bar (|), double quotation mark ("), single quotation mark ('), comma (,), colon (:), percent sign (%), left angle bracket (<), right angle bracket (>), forward slash (/), and backslash (\).
password: Specifies the password for accessing the email server.
cipher: Specifies a password in encrypted form.
simple: Specifies a password in plaintext form. For security purposes, the password specified in plaintext form will be stored in encrypted form.
password: Specifies the password. Its plaintext form is a case-sensitive string of 1 to 63 characters. Its encrypted form is a case-sensitive string of 1 to 117 characters.
Usage guidelines
If you execute this command multiple times, the most recent configuration takes effect.
Examples
# Set the username for accessing the email server to admin and the password to abc123 in plaintext form.
<Sysname> system-view
[Sysname] mail-server smtp-server1
[Sysname-mail-server-smtp-server1] mail-server username admin password simple abc123
mail-subject
Use mail-subject to set the email subject.
Use undo mail-subject to restore the default.
Syntax
mail-subject subject-text
undo mail-subject
Default
No email subject is set.
Views
Email notification service view
Predefined user roles
network-admin
Parameters
subject-text: Set an email subject. The value is a case-sensitive string of 1 to 255 characters. The subject cannot these special characters: ampersand (&), vertical bar (|), double quotation mark ("), single quotation mark ('), comma (,), colon (:), percent sign (%), left angle bracket (<), right angle bracket (>), forward slash (/), and backslash (\).
Examples
# Set the email subject to test for email notification service smtp-server1.
<Sysname> system-view
[Sysname] mail-serve smtp-server1
[Sysname-mail-server-smtp-server1] mail-subject test