SMTP Configuration#
The Janssen Server provides multiple configuration tools to perform these tasks.
Use the command line to perform actions from the terminal. Learn how to use Jans CLI here or jump straight to the Using Command Line
Use a fully functional text-based user interface from the terminal. Learn how to use Jans Text-based UI (TUI) here or jump straight to the Using Text-based UI
Use REST API for programmatic access or invoke via tools like CURL or Postman. Learn how to use Janssen Server Config API here or Jump straight to the Using Configuration REST API
Using Command Line#
In the Janssen Server, you can deploy and customize the SMTP using the
command line. To get the details of Janssen command line operations relevant to
SMTP Configuration, you can check the operations under ConfigurationSmtp
task using the command below:
jans cli --info ConfigurationSmtp
Operation ID: get-config-smtp
Description: Returns SMTP server configuration
Operation ID: put-config-smtp
Description: Updates SMTP server configuration
Schema: SmtpConfiguration
Operation ID: post-config-smtp
Description: Adds SMTP server configuration
Schema: SmtpConfiguration
Operation ID: delete-config-smtp
Description: Deletes SMTP server configuration
Operation ID: test-config-smtp
Description: Signing Test SMTP server configuration
Schema: SmtpTest
Find SMTP Server Configuration#
To view the current SMTP server configuration, run the following command line:
jans cli --operation-id get-config-smtp
It will show the SMTP server configuration as below:
Sample Output | |
---|---|
1 2 3 4 5 6 7 8 9 10 |
|
Setup New SMTP Server Configuration#
To add a new SMTP Server, we can use post-config-smtp
operation id.
As shown in the output for--info
command, the post-config-smtp
operation requires data to be sent
according to the SmtpConfiguration
schema.
To see the schema, use the command below:
jans cli --schema SmtpConfiguration
The Janssen Server also provides an example of data that adheres to the above schema. To fetch the example, use the command below.
jans cli --schema-sample SmtpConfiguration
Using the schema and the example above, we have added below data to the file
/tmp/smtp.json
.
Input | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
To setup a new SMTP server configuration, run the following command:
jans cli --operation-id post-config-smtp \
--data /tmp/smtp.json
Sample Output | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Update SMTP Server Configuration#
To update the SMTP server, we can use the put-config-smtp
operation id.
simply change any information on /tmp/smtp.json
file and run the following
command:
In that file, update the value false
to true
of the trust_host
field.
jans cli --operation-id put-config-smtp \
--data /tmp/smtp.json
Delete SMTP Sever Configuration#
To delete the SMTP Sever, we can use the delete-config-smtp
operation id.
run the following command
jans cli --operation-id delete-config-smtp
Test SMTP Server Configuration#
Testing SMTP Server configuration token with https://jans.io/oauth/config/smtp.write
scope is required. To test the SMTP server configuration update, change any information
on the /tmp/smtp.json
file with test data and run the following command:
jans cli --operation-id test-config-smtp \
--data /tmp/smtp.json
SMTP Password
should be an App password and not a web login password.
Using Text-based UI#
Start TUI using the command below:
jans tui
SMPT Screen#
Navigate to Auth Server
-> SMPT
to open the SMPT screen as shown
in the image below.
- This screen shows the current SMTP server configuration.
- After changing the SMPT data, update the SMPT server using the
Save
button. - Test the SMPTS server using the
Test
button, and the result will be displayed.
The test result image is shown below.
Using Configuration REST API#
Janssen Server Configuration REST API exposes relevant endpoints for managing and configuring the SMTP. Endpoint details are published in the Swagger document.
Created: 2021-04-22