Adding an SMTP server

You can add an SMTP server to IBM Spectrum Protect Plus.

Method and URI

To add an SMTP server, use a POST method with a URI:

POST    https://{hostname|IPv4}/ngp/smtp

Parameters

None.

Data

Data 1: hostAddress

The IP address of the host, or the path and hostname of the SMTP server.

  • Example value: 10.0.0.121

  • Type: String. Required. Available in the web user interface.

Data 2: portNumber

The communications port of the server that you are adding. The default port number is 25 for non-SSL connections or 443 for SSL connections.

  • Example value: 25

  • Type: Integer. Required. Available in the web user interface.

Data 3: username

The name that is used to access the SMTP server.

  • Example value: sarah-smtp

  • Type: String. Available in the web user interface.

Data 4: password

The name that is used to access the SMTP server.

  • Example value: ?^y{+~k9R8S*S4FW

  • Type: String. Requried, if username has a value. Available in the web user interface.

The password that is associated with the username.

Data 5: timeout

The email timeout value in milliseconds.

  • Example value: 10000

  • Type: Integer. Available in the web user interface.

Data 6: fromAddress

The address that is associated with email communications from IBM Spectrum Protect Plus.

  • Example value: smtp@bluemachines.com.invalid

  • Type: String. Available in the web user interface.

Data 7: subjectPrefix

The prefix for email subject lines sent from IBM Spectrum Protect Plus.

  • Example value: IBM Spectrum Protect Plus:

  • Type: String. Available in the web user interface.

Example: Add an SMTP server to IBM Spectrum Protect Plus

Assume that you want to add the following SMTP server to IBM Spectrum Protect Plus:

  • Host address: 10.0.0.121

  • Port: 25 (SMTP without SSL encryption)

  • Username: sarah-smtp

  • Password: ?^y{+~k9R8S*S4FW

  • Timeout: 10,000 milliseconds (10 seconds)

  • From address: smtp@bluemachines.com.invalid

  • subjectPrefix: IBM Spectrum Protect Plus:

A Python snippet that is similar to the following example can be used to add the SMTP server:

_data = f'''{{
    "hostAddress":   "10.0.0.121",
    "portNumber":    25,
    "username":      "sarah-smtp",
    "password":      "?^y{{+~k9R8S*S4FW",
    "timeout":       10000,
    "fromAddress":   "smtp@bluemachines.com.invalid",
    "subjectPrefix": "IBM Spectrum Protect Plus :"
}}'''

requests.post('https://' + spp_ipv4 + '/ngp/smtp',
    headers={...}, data=_data, verify=...)
_images/reference_smtp_create02.png

Figure 57 The same action can be taken in the IBM Spectrum Protect Plus web user interface: In the navigation pane, click System Configuration > LDAP / SMTP and click the SMTP Server tab. Click Add SMTP Server. Enter the required values in the fields and click Save.

The request prompts a response that is structured as shown, with the HTTP status of 201 (Created). Review the response to ensure that the SMTP server 10.0.0.121 was added. The response body is similar to the JSON object for it that is shown in Getting SMTP server information.