Editing the configuration of an SMTP server

You can edit an SMTP server configuration.

Method and URI

To edit the configuration of the SMTP server, use a PUT method with a URI:

PUT     https://{hostname|IPv4}/ngp/smtp/{smtpId}

Tip

To get an {smtpId}, follow the instructions in Getting an {smtpId}.

Parameters

None.

Data

You can use the data key-value pairs that are listed in Adding an SMTP server.

Example: Edit the configuration of an SMTP server

Assume that you want to edit the configuration of an SMTP server with the following {smtpId} value: 1002. You want to assign the following values to this SMTP server:

  • Port: 443 (HTTP with SSL encryption)

  • From address smtp.dallas@bluemachines.com.invalid

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

smtp_id = "1002"

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

requests.put('https://' + spp_ipv4 + '/ngp/smtp/' + smtp_id,
    headers={...}, params="", data=_data, verify=...)

After you run the Python snippet, ensure that you get a response with the HTTP status of 200 (OK) and that the SMTP server settings are updated.