Explorar el Código

[fix issue 1484] Allow to send email without auth again (#1485)

* We can now send email with plain auth
* better defaults for email plugin

Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
Manuel Sabban hace 3 años
padre
commit
589a30cd5f
Se han modificado 1 ficheros con 2 adiciones y 13 borrados
  1. 2 13
      plugins/notifications/email/main.go

+ 2 - 13
plugins/notifications/email/main.go

@@ -53,11 +53,12 @@ type EmailPlugin struct {
 
 func (n *EmailPlugin) Configure(ctx context.Context, config *protobufs.Config) (*protobufs.Empty, error) {
 	d := PluginConfig{
-		SMTPPort:       587,
+		SMTPPort:       25,
 		SenderName:     "Crowdsec",
 		EmailSubject:   "Crowdsec notification",
 		EncryptionType: "ssltls",
 		AuthType:       "login",
+		SenderEmail:    "crowdsec@crowdsec.local",
 	}
 
 	if err := yaml.Unmarshal(config.Config, &d); err != nil {
@@ -72,18 +73,6 @@ func (n *EmailPlugin) Configure(ctx context.Context, config *protobufs.Config) (
 		return nil, fmt.Errorf("SMTP host is not set")
 	}
 
-	if d.SMTPUsername == "" {
-		return nil, fmt.Errorf("SMTP username is not set")
-	}
-
-	if d.SMTPPassword == "" {
-		return nil, fmt.Errorf("SMTP password is not set")
-	}
-
-	if d.SenderEmail == "" {
-		return nil, fmt.Errorf("Sender email is not set")
-	}
-
 	if d.ReceiverEmails == nil || len(d.ReceiverEmails) == 0 {
 		return nil, fmt.Errorf("Receiver emails are not set")
 	}