Files
zitadel/internal/notification/channels/smtp/config.go
T
Wim Van LaerandGitHub c172adfc53 fix: allow for the smtp-config to have no password set. (#11193)
<!--
Please inform yourself about the contribution guidelines on submitting a
PR here:
https://github.com/zitadel/zitadel/blob/main/CONTRIBUTING.md#submit-a-pull-request-pr.
Take note of how PR/commit titles should be written and replace the
template texts in the sections below. Don't remove any of the sections.
It is important that the commit history clearly shows what is changed
and why.
Important: By submitting a contribution you agree to the terms from our
Licensing Policy as described here:
https://github.com/zitadel/zitadel/blob/main/LICENSING.md#community-contributions.
-->

# Which Problems Are Solved

Adding a generic SMTP server using the gRPC endpoints resulted in an
error. This was because the password field was requried.


# How the Problems Are Solved

Removed the requirement for a password from the mail config.


# Additional Context

closes #11084
2026-01-13 07:36:33 +00:00

30 lines
702 B
Go

package smtp
type Config struct {
SMTP SMTP
Tls bool
From string
FromName string
ReplyToAddress string
}
type SMTP struct {
Host string
User string
Password string
}
// HasAuth reports whether SMTP authentication should be attempted.
//
// It returns true when a User is configured, regardless of whether Password
// is set. This behavior is intentional to support SMTP servers that allow
// authentication without a password. For servers that require a password,
// this means authentication may still be attempted with an empty password.
func (smtp *SMTP) HasAuth() bool {
return smtp.User != ""
}
type ConfigHTTP struct {
Endpoint string
}