Configuring the SMTP server
The PingDirectory server supports SSL, StartTLS, and simple SMTP server connections. For SSL and StartTLS connections, you can authenticate using a username and password or a bearer token.
After configuring your connection type, register the server in the Setting the SMTP server section.
SSL connection
Steps
-
To create an external SMTP server using SSL, run the
dsconfigcommand.Example:
$ bin/dsconfig create-external-server \ --server-name ssl.smtp.example.com \ --type smtp \ --set server-host-name:smtp.gmail.com \ --set server-port:465 \ --set smtp-security:ssl \ --set "user-name:my.name@example.com" \ --set password:xxxxxx \ --set "smtp-timeout:10s"
SSL connection using OAuth
Before you begin
Configure a bearer token HTTP authorization method. Learn more in Configuring bearer token authentication for SMTP.
Steps
-
To create an external SMTP server using SSL and bearer token authentication, run the
dsconfigcommand.Example:
$ bin/dsconfig create-external-server \ --server-name ssl.smtp.example.com \ --type smtp \ --set server-host-name:smtp.office365.com \ --set server-port:465 \ --set smtp-security:ssl \ --set "user-name:my.name@example.com" \ --set "token-acquisition-method:SMTP Bearer Token"
StartTLS connection
Steps
-
To configure a StartTLS connection to the server, use the
dsconfigcommand.Example:
$ bin/dsconfig create-external-server \ --server-name myTLSServer \ --type smtp \ --set server-host-name:tls.smtp.example.com \ --set server-port:587 \ --set smtp-security:starttls \ --set user-name:MyAccountName \ --set password:AAD5yZ+DjvwiYkBSMer6GQ6B3szQ6gSSBjA=
StartTLS connection using OAuth
Before you begin
Configure a bearer token HTTP authorization method. Learn more in Configuring bearer token authentication for SMTP.
Steps
-
To configure a StartTLS connection to the server with bearer token authentication, use the
dsconfigcommand.Example:
$ bin/dsconfig create-external-server \ --server-name myTLSServer \ --type smtp \ --set server-host-name:smtp.office365.com \ --set server-port:587 \ --set smtp-security:starttls \ --set "user-name:my.name@example.com" \ --set "token-acquisition-method:SMTP Bearer Token"
Simple connection
Steps
-
To configure a simple mail server, use the
dsconfigcommand.Example:
$ bin/dsconfig create-external-server --server-name smtp1 \ --type smtp --set server-host-name:smtp.example.com
Setting the SMTP server
After creating the SMTP external server, register it in the global configuration.
Steps
-
To register the SMTP server, use the
dsconfigcommand.Example:
$ bin/dsconfig set-global-configuration-prop \ --set smtp-server:smtp1This command adds the server to the global list of mail servers that the PingDirectory server can use.