From cec708a9686dd35df98ef285dcb0aac855760233 Mon Sep 17 00:00:00 2001 From: StanMar-bit <84271654+StanMar-bit@users.noreply.github.com> Date: Sun, 25 Dec 2022 10:11:37 +0100 Subject: [PATCH] fix(authelia): Allow SMTP without username and password (SMTP relay) (#5770) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * SMTP username and password not required for support SMTP relays I have changed the requiredness of the SMTP settings password and username field, to not required. This is necessary to support SMTP relays without authentication. (Like the Exchange Online one I’am using with ip verification) Signed-off-by: StanMar-bit <84271654+StanMar-bit@users.noreply.github.com> * adjust templates to handle smtp without user/pass Signed-off-by: StanMar-bit <84271654+StanMar-bit@users.noreply.github.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/stable/authelia/Chart.yaml | 2 +- charts/stable/authelia/questions.yaml | 2 -- charts/stable/authelia/templates/_configmap.tpl | 4 +++- charts/stable/authelia/templates/_secrets.tpl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/stable/authelia/Chart.yaml b/charts/stable/authelia/Chart.yaml index 1daa58f2e84..f7c7138e4a4 100644 --- a/charts/stable/authelia/Chart.yaml +++ b/charts/stable/authelia/Chart.yaml @@ -39,7 +39,7 @@ sources: - https://github.com/authelia/chartrepo - https://github.com/authelia/authelia type: application -version: 14.0.17 +version: 14.0.18 annotations: truecharts.org/catagories: | - security diff --git a/charts/stable/authelia/questions.yaml b/charts/stable/authelia/questions.yaml index 99d8e1d35e8..ee71113c598 100644 --- a/charts/stable/authelia/questions.yaml +++ b/charts/stable/authelia/questions.yaml @@ -509,13 +509,11 @@ questions: schema: type: string default: "" - required: true - variable: plain_password label: "Password" schema: type: string default: "" - required: true - variable: sender label: "Sender" schema: diff --git a/charts/stable/authelia/templates/_configmap.tpl b/charts/stable/authelia/templates/_configmap.tpl index ca0842c6d98..9424df306ad 100644 --- a/charts/stable/authelia/templates/_configmap.tpl +++ b/charts/stable/authelia/templates/_configmap.tpl @@ -173,7 +173,9 @@ data: host: {{ $notifier.smtp.host }} port: {{ default 25 $notifier.smtp.port }} timeout: {{ default "5s" $notifier.smtp.timeout }} - username: {{ $notifier.smtp.username }} + {{- with $notifier.smtp.username }} + username: {{ . }} + {{- end }} sender: {{ $notifier.smtp.sender }} identifier: {{ $notifier.smtp.identifier }} subject: {{ $notifier.smtp.subject | quote }} diff --git a/charts/stable/authelia/templates/_secrets.tpl b/charts/stable/authelia/templates/_secrets.tpl index 81fbe92ff70..3c66d93cf99 100644 --- a/charts/stable/authelia/templates/_secrets.tpl +++ b/charts/stable/authelia/templates/_secrets.tpl @@ -36,7 +36,7 @@ data: LDAP_PASSWORD: {{ .Values.authentication_backend.ldap.plain_password | b64enc | quote }} {{- end }} - {{- if .Values.notifier.smtp.enabled }} + {{- if and .Values.notifier.smtp.enabled .Values.notifier.smtp.plain_password }} SMTP_PASSWORD: {{ .Values.notifier.smtp.plain_password | b64enc | quote }} {{- end }}