Skip to content

Commit 1dcf9f4

Browse files
wI2Lrbeuque74
authored andcommitted
refactor: plugin email without auth
Signed-off-by: William Poussier <william.poussier@gmail.com>
1 parent a596736 commit 1dcf9f4

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

pkg/plugins/builtin/email/README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ This plugin send an email.
44

55
## Configuration
66

7-
|Fields|Description
8-
|---|---
9-
| `smtp_username` | username of SMTP server
10-
| `smtp_password` | password of SMTP server
11-
| `smtp_port` | port of SMTP server
12-
| `smtp_hostname` | hostname of SMTP server
13-
| `smtp_skip_tls_verif` | Skip or not TLS insecure verify
14-
| `from_address` | from which email you want to send the message
15-
| `from_name` | from which name you want to send the message
16-
| `to` | receiver(s) of your email
17-
| `subject` | subject of your email
18-
| `body` | content of your email
7+
| Fields | Description |
8+
| --------------------- | --------------------------------------------- |
9+
| `smtp_username` | username of SMTP server |
10+
| `smtp_password` | password of SMTP server |
11+
| `smtp_port` | port of SMTP server |
12+
| `smtp_hostname` | hostname of SMTP server |
13+
| `smtp_skip_tls_verif` | Skip or not TLS insecure verify |
14+
| `from_address` | from which email you want to send the message |
15+
| `from_name` | from which name you want to send the message |
16+
| `to` | receiver(s) of your email |
17+
| `subject` | subject of your email |
18+
| `body` | content of your email |
1919

2020
## Example
2121

@@ -25,9 +25,9 @@ An action of type `email` requires the following kind of configuration:
2525
action:
2626
type: email
2727
configuration:
28-
# mandatory, string
28+
# optional, string, leave empty for no auth
2929
smtp_username: {{.config.smtp.username}}
30-
# mandatory, string
30+
# optional, string, leave empty for no auth
3131
smtp_password: {{.config.smtp.password}}
3232
# mandatory, string as uint
3333
smtp_port: {{.config.smtp.port}}
@@ -68,4 +68,4 @@ Sensitive data should be retrieved from configstore and accessed through `{{.con
6868

6969
The `email` plugin declares automatically resources for its steps:
7070
- `socket` to rate-limit concurrent execution on the number of open outgoing sockets
71-
- `url:smtp_hostname` (where `smtp_hostname` is the outgoing SMTP server of the plugin configuration) to rate-limit concurrent execution on a specific outgoing SMTP server
71+
- `url:smtp_hostname` (where `smtp_hostname` is the outgoing SMTP server of the plugin configuration) to rate-limit concurrent execution on a specific outgoing SMTP server

pkg/plugins/builtin/email/email.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ type Config struct {
4141
func validConfig(config interface{}) error {
4242
cfg := config.(*Config)
4343

44-
if cfg.SMTPUsername == "" {
45-
return errors.New("smtp_username is missing")
46-
}
47-
48-
if cfg.SMTPPassword == "" {
49-
return errors.New("smtp_password is missing")
50-
}
51-
5244
if cfg.SMTPPort == "" {
5345
return errors.New("smtp_port is missing")
5446
}

0 commit comments

Comments
 (0)