|
@@ -46,6 +46,7 @@ type PluginConfig struct {
|
|
EmailSubject string `yaml:"email_subject"`
|
|
EmailSubject string `yaml:"email_subject"`
|
|
EncryptionType string `yaml:"encryption_type"`
|
|
EncryptionType string `yaml:"encryption_type"`
|
|
AuthType string `yaml:"auth_type"`
|
|
AuthType string `yaml:"auth_type"`
|
|
|
|
+ HeloHost string `yaml:"helo_host"`
|
|
}
|
|
}
|
|
|
|
|
|
type EmailPlugin struct {
|
|
type EmailPlugin struct {
|
|
@@ -60,6 +61,7 @@ func (n *EmailPlugin) Configure(ctx context.Context, config *protobufs.Config) (
|
|
EncryptionType: "ssltls",
|
|
EncryptionType: "ssltls",
|
|
AuthType: "login",
|
|
AuthType: "login",
|
|
SenderEmail: "crowdsec@crowdsec.local",
|
|
SenderEmail: "crowdsec@crowdsec.local",
|
|
|
|
+ HeloHost: "localhost",
|
|
}
|
|
}
|
|
|
|
|
|
if err := yaml.Unmarshal(config.Config, &d); err != nil {
|
|
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.Password = cfg.SMTPPassword
|
|
server.Encryption = EncryptionStringToType[cfg.EncryptionType]
|
|
server.Encryption = EncryptionStringToType[cfg.EncryptionType]
|
|
server.Authentication = AuthStringToType[cfg.AuthType]
|
|
server.Authentication = AuthStringToType[cfg.AuthType]
|
|
|
|
+ server.Helo = cfg.HeloHost
|
|
|
|
|
|
logger.Debug("making smtp connection")
|
|
logger.Debug("making smtp connection")
|
|
smtpClient, err := server.Connect()
|
|
smtpClient, err := server.Connect()
|