Added AUTH command and PLAIN sasl mechanism
This commit is contained in:
parent
3523f1cf4e
commit
86dc81451a
7 changed files with 75 additions and 24 deletions
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue