mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
Add helo config (#1765)
HELO message always need to send an ip or FQDN, set localhost to be default instead of doing an if statement. (Replicate same default in email client)
This commit is contained in:
parent
33383faf9e
commit
04a8fb7f81
1 changed files with 3 additions and 0 deletions
|
@ -46,6 +46,7 @@ type PluginConfig struct {
|
|||
EmailSubject string `yaml:"email_subject"`
|
||||
EncryptionType string `yaml:"encryption_type"`
|
||||
AuthType string `yaml:"auth_type"`
|
||||
HeloHost string `yaml:"helo_host"`
|
||||
}
|
||||
|
||||
type EmailPlugin struct {
|
||||
|
@ -60,6 +61,7 @@ func (n *EmailPlugin) Configure(ctx context.Context, config *protobufs.Config) (
|
|||
EncryptionType: "ssltls",
|
||||
AuthType: "login",
|
||||
SenderEmail: "crowdsec@crowdsec.local",
|
||||
HeloHost: "localhost",
|
||||
}
|
||||
|
||||
if err := yaml.Unmarshal(config.Config, &d); err != nil {
|
||||
|
@ -104,6 +106,7 @@ func (n *EmailPlugin) Notify(ctx context.Context, notification *protobufs.Notifi
|
|||
server.Password = cfg.SMTPPassword
|
||||
server.Encryption = EncryptionStringToType[cfg.EncryptionType]
|
||||
server.Authentication = AuthStringToType[cfg.AuthType]
|
||||
server.Helo = cfg.HeloHost
|
||||
|
||||
logger.Debug("making smtp connection")
|
||||
smtpClient, err := server.Connect()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue