1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-08-13 20:04:49 +02:00

Feature: Add TLS relay support and refactor relay function (#471)

* Feature: Add TLS relay support and refactoring the relay function

* Fix: Prevent simultaneous use of TLS and STARTTLS in relay configuration validation
This commit is contained in:
San Chen
2025-03-29 04:36:00 +08:00
committed by Ralph Slooten
parent 54b6d8f85c
commit 2dbc4ea601
4 changed files with 47 additions and 13 deletions

View File

@@ -292,6 +292,7 @@ func initConfigFromEnv() {
config.SMTPRelayConfig.Port, _ = strconv.Atoi(os.Getenv("MP_SMTP_RELAY_PORT"))
}
config.SMTPRelayConfig.STARTTLS = getEnabledFromEnv("MP_SMTP_RELAY_STARTTLS")
config.SMTPRelayConfig.TLS = getEnabledFromEnv("MP_SMTP_RELAY_TLS")
config.SMTPRelayConfig.AllowInsecure = getEnabledFromEnv("MP_SMTP_RELAY_ALLOW_INSECURE")
config.SMTPRelayConfig.Auth = os.Getenv("MP_SMTP_RELAY_AUTH")
config.SMTPRelayConfig.Username = os.Getenv("MP_SMTP_RELAY_USERNAME")