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