SMTP config for Portal installation
search cancel

SMTP config for Portal installation

book

Article ID: 424940

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

I’m trying to set up SMTP config but emails are not working. I’m trying to set it up as Anonymous. We do not need username/password for SMTP connections.

I have tried several options in values.yaml but none of them sent the email. I also tried to set it up in Portal, logging as a Admin and setting up Custom Email/SMTP. Do you know which pod will have logs when smtp is setup using UI.

 

I see the logs from portal-data having details from the startup that include an interesting message that contains reference to a ca.com machine name that we did not set:

 

[system-portal.log] [2026-01-05 15:44:10,208] [INFO ] [c.c.a.n.s.d.DefaultConfig] [main] [|] [|||] DefaultConfig [host=smtp.example.com, port=25, username= , requireSsl=false, [email protected]

 

I had tried these options in values.yaml

 

smtp:

  host: smtp.example.com

  port: 25

  username: " "

  password: " "

  requireSSL: false

  cert: ""

 

 

smtp:

  host: smtp.example.com

  port: 25

  username: ""

  password: ""

  requireSSL: false

  cert: ""

 

smtp:

  host: smtp.example.com

  port: 25

  username: "none"

  password: "none"

  requireSSL: false

  cert: ""

 

 

smtp:

  host: smtp.example.com

  port: 25

  username: "none"

  password: "none"

  requireSSL: false

  from: "[email protected]"

  cert: ""

Environment

Component \: CA API Portal
Helm Portal Chart Version: 2.3.18

Cause

defaultSenderAddress is not set through the values.yaml

Some of the smtp server may have its own restrictions to help deliver outgoing email request. 

Resolution

There are two issues in this subject:

Configure SMTP server to be willing to help deliver outgoing email from portal

This is SMTP server specific. You need to consult your SMTP server administrator for them to configure the SMTP server to allow your portal server to use it to deliver outgoing emails. The configuration details may include:

  • necessary firewall rules to allow portal to connect to the SMTP server, the commonly used port number is 25 but could be something different
  • whether authentication the SMTP server is required, this may include account/password required to connec to the SMTP Server
  • whether communication to the SMTP requires SSL/TLS connection and hence require a certificate to connect
  • whether the portal needs to be on the whitelist or something similar to allow it to connect

What to configure on CA API Portal

  • Configure SMTP at Tenant Level

It may be a bit inconvenient to set the SMTP at the tenant level, especially if you have multiple tenants. However, it does allow you to set the custom sender address. Please see the following product documentation for further details:

Configure Mail Server at Tenant Level

  • Install Portal on Docker Swarm

If your Poral is installed on a Docker Swarm, the following product link explains how to configure SMTP at Portal level:

Configure SMTP at Portal Level

  • Install Portal on Kubernetes

When a Portal is installed on Kubernetes, the SMTP configuration at Portal Level can be done through the a values.yaml overwrite. The documentation of the values.yaml is somewhat minimal through the values.yaml and prooduction-values.yaml on the github portal page:

Layer7 API Developer Portal Helm Chart

Since its documentation is rather limited and the default sender address is set to [email protected], You would wonder whether you can use anything under the top key, smtp, to set your own default sender address. To learn more about the actually possibilies, you first need to identify the portal helm chart version you are using. The default version of a helm install/helm upgrade version can be found using

helm search repo layer7/portal

assuming your helm repo name is set to layer7. Or you can use the following command and sample output to match/identify the portal (APP) version with the helm CHART version

$ helm search repo layer7/portal --versions

NAME            CHART VERSION   APP VERSION     DESCRIPTION            
layer7/portal   2.3.20          5.4             CA API Developer Portal
layer7/portal   2.3.19          5.4             CA API Developer Portal
layer7/portal   2.3.18          5.3.3.1         CA API Developer Portal
layer7/portal   2.3.17          5.3.3.1         CA API Developer Portal
layer7/portal   2.3.16          5.3.3           CA API Developer Portal
...

Then the following command will pull the particular helm chart version, likes 2.3.18, and untar the result under the portal subdirectory where you issue the command:

helm pull layer7/portal --version 2.3.18 --untar

Further, the following command and sample output show the search into the downloaded helm chart and where the values set through the values.yaml are being used.

$ find portal -type f -exec grep -i smtp {} +
portal/README.md:* [SMTP Settings](#smtp-parameters)
portal/README.md:### SMTP Parameters
portal/README.md:| `smtp.host` | SMTP Host | `notinstalled` |
portal/README.md:| `smtp.port` | SMTP Port | `notinstalled` |
portal/README.md:| `smtp.username` | SMTP Username | `notinstalled` |
portal/README.md:| `smtp.password` | SMTP Password | `notinstalled` |
portal/README.md:| `smtp.requireSSL` | Require SSL for the SMTP Server | `false` |
portal/README.md:| `smtp.cert` | SMTP Server certificate | `notinstalled` |
portal/templates/_helpers.tpl:Get a user provided SMTP certificate
portal/templates/_helpers.tpl:{{- define "smtp-external-crt" -}}
portal/templates/_helpers.tpl:    {{- if and (eq .Values.smtp.cert "notinstalled") .Values.smtp.requireSSL }}
portal/templates/_helpers.tpl:        {{- fail "Please set smtp.cert via set file or disable smtp.requireSSL" }}
portal/templates/_helpers.tpl:        {{- print .Values.smtp.cert | b64enc | quote }}
portal/templates/portal-data/portal-data-secret.yaml:  CONFIG_MAIL_SMTP_USERNAME: {{ required "Please fill in smtp.username in values.yaml" .Values.smtp.username | b64enc | quote }}
portal/templates/portal-data/portal-data-secret.yaml:  CONFIG_MAIL_SMTP_PASSWORD: {{ required "Please fill in smtp.password in values.yaml" .Values.smtp.password | b64enc | quote }}
portal/templates/portal-data/portal-data-secret.yaml:  CONFIG_MAIL_SMTP_CERT: {{ include "smtp-external-crt" . | b64enc }}
portal/templates/portal-data/portal-data-config.yaml:  CONFIG_MAIL_SMTP_HOST: {{ required "Please fill in smtp.host in values.yaml" .Values.smtp.host }}
portal/templates/portal-data/portal-data-config.yaml:  CONFIG_MAIL_SMTP_PORT: {{ required "Please fill in smtp.port in values.yaml" .Values.smtp.port | quote }}
portal/templates/portal-data/portal-data-config.yaml:  CONFIG_MAIL_SMTP_REQUIRE_SSL: {{ required "Please fill in smtp.requireSSL in values.yaml" .Values.smtp.requireSSL | quote }}
portal/values.yaml:smtp:
portal/values-production.yaml:smtp:

In this sample, it shows that no place in this portal helm chart, the from key in the reported description is used at all.