[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>
This commit is contained in:
Manuel Sabban 2022-04-27 12:07:54 +02:00 committed by GitHub
parent a645c928d4
commit 589a30cd5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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")
}