[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:
parent
a645c928d4
commit
589a30cd5f
1 changed files with 2 additions and 13 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue