From bf5be2da6993e5c06513a4ccea5cd4d4353ff435 Mon Sep 17 00:00:00 2001 From: Gokhan Sari Date: Mon, 18 Nov 2024 23:27:10 +0300 Subject: [PATCH] Fix SMTP stuff --- backend/pkg/poeticmetric/env_service.go | 10 +++++----- backend/pkg/service/env/main.go | 2 +- chart/templates/configmap-smtp.yaml | 2 +- chart/values.yaml | 2 +- etc/development/values.yaml | 2 +- etc/staging/values.yaml | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/pkg/poeticmetric/env_service.go b/backend/pkg/poeticmetric/env_service.go index e6400da5..474e4057 100644 --- a/backend/pkg/poeticmetric/env_service.go +++ b/backend/pkg/poeticmetric/env_service.go @@ -49,9 +49,9 @@ type EnvServiceVars struct { RedisPort int `env:"REDIS_PORT,notEmpty,required"` // SMTP - SmtpFrom string `env:"SMTP_FROM,notEmpty,required"` - SmtpHost string `env:"SMTP_HOST,notEmpty,required"` - SmtpPassword string `env:"SMTP_PASSWORD"` - SmtpPort string `env:"SMTP_PORT,notEmpty,required"` - SmtpUser string `env:"SMTP_USER"` + SmtpFromAddress string `env:"SMTP_FROM_ADDRESS,notEmpty,required"` + SmtpHost string `env:"SMTP_HOST,notEmpty,required"` + SmtpPassword string `env:"SMTP_PASSWORD"` + SmtpPort string `env:"SMTP_PORT,notEmpty,required"` + SmtpUser string `env:"SMTP_USER"` } diff --git a/backend/pkg/service/env/main.go b/backend/pkg/service/env/main.go index 38b810e6..6ed6cc5e 100644 --- a/backend/pkg/service/env/main.go +++ b/backend/pkg/service/env/main.go @@ -118,7 +118,7 @@ func (s *service) SmtpAuth() smtp.Auth { } func (s *service) SmtpFrom() string { - return s.vars.SmtpFrom + return fmt.Sprintf("PoeticMetric <%s>", s.vars.SmtpFromAddress) } var Logger = zerolog.New(os.Stdout).With().Timestamp().Logger() diff --git a/chart/templates/configmap-smtp.yaml b/chart/templates/configmap-smtp.yaml index 124783cd..3b603842 100644 --- a/chart/templates/configmap-smtp.yaml +++ b/chart/templates/configmap-smtp.yaml @@ -5,6 +5,6 @@ metadata: {{ include "poeticmetric.labels" . | nindent 4 }} name: {{ include "poeticmetric.fullname" . }}-smtp data: - FROM: {{ .Values.poeticmetric.smtp.from | quote }} + FROM_ADDRESS: {{ .Values.poeticmetric.smtp.fromAddress | quote }} HOST: {{ .Values.poeticmetric.smtp.host | quote }} PORT: {{ .Values.poeticmetric.smtp.port | quote }} diff --git a/chart/values.yaml b/chart/values.yaml index 4a1c0bc1..64d85aa0 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -65,7 +65,7 @@ poeticmetric: replicas: 1 resources: {} smtp: - from: PoeticMetric + fromAddress: poeticmetric@poeticmetric.com host: "" password: "" port: 587 diff --git a/etc/development/values.yaml b/etc/development/values.yaml index b74e75b7..6b95e77c 100644 --- a/etc/development/values.yaml +++ b/etc/development/values.yaml @@ -27,7 +27,7 @@ poeticmetric: annotations: cert-manager.io/cluster-issuer: self-signed smtp: - from: PoeticMetric + fromAddress: poeticmetric@dev.poeticmetric.com host: poeticmetric-mailpit port: "1025" postgres: diff --git a/etc/staging/values.yaml b/etc/staging/values.yaml index fe6edc91..d9672cd8 100644 --- a/etc/staging/values.yaml +++ b/etc/staging/values.yaml @@ -23,7 +23,7 @@ poeticmetric: cert-manager.io/cluster-issuer: letsencrypt-prod-poeticmetric resources: {} smtp: - from: PoeticMetric + fromAddress: poeticmetric@staging.poeticmetric.com host: email-smtp.eu-west-1.amazonaws.com port: 587 redis: