Added AUTH command and PLAIN sasl mechanism

This commit is contained in:
Gnarwhal 2024-10-02 07:56:56 +00:00
parent 3523f1cf4e
commit 86dc81451a
Signed by: Gnarwhal
GPG key ID: 0989A73D8C421174
7 changed files with 75 additions and 24 deletions

View file

@ -24,12 +24,17 @@ import (
)
type Config struct {
LogLevel string
Host string
General GeneralConfig
Plain PlainConfig
TLS TLSConfig
}
type GeneralConfig struct {
LogLevel string
Host string
PasswordHash string
}
type PlainConfig struct {
Enabled bool
Port string

View file

@ -62,8 +62,8 @@ func main() {
log.Fatal().Msgf("%v", err)
}
if log_level == "" {
if config.LogLevel != "" {
log_level = config.LogLevel
if config.General.LogLevel != "" {
log_level = config.General.LogLevel
} else {
log_level = "info"
}
@ -107,7 +107,8 @@ func main() {
}
err = smtp.Run(
config.Host,
config.General.Host,
config.General.PasswordHash,
plain_config,
tls_config,
)