Flip starttls flag to fix #58
This commit is contained in:
parent
c75190e21a
commit
7340d3d417
4
DOCS.md
4
DOCS.md
|
@ -10,7 +10,7 @@ You can configure the plugin using the following parameters:
|
|||
* **username** - SMTP username
|
||||
* **password** - SMTP password
|
||||
* **skip_verify** - Skip verification of SSL certificates, defaults to `false`
|
||||
* **starttls** - Enable/Disable STARTTLS
|
||||
* **no_starttls** - Enable/Disable STARTTLS
|
||||
* **recipients** - List of recipients to send this mail to (besides the commit author)
|
||||
* **recipients_file** - Filename to load additional recipients from (textfile with one email per line) (besides the commit author)
|
||||
* **recipients_only** - Do not send mails to the commit author, but only to **recipients**, defaults to `false`
|
||||
|
@ -145,5 +145,5 @@ steps:
|
|||
host: smtp.mailgun.org
|
||||
username: octocat
|
||||
password: 12345
|
||||
+ starttls: false
|
||||
+ no_starttls: true
|
||||
```
|
||||
|
|
6
main.go
6
main.go
|
@ -67,9 +67,9 @@ func main() {
|
|||
EnvVar: "PLUGIN_SKIP_VERIFY",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "starttls",
|
||||
Name: "no.starttls",
|
||||
Usage: "Enable/Disable STARTTLS",
|
||||
EnvVar: "PLUGIN_STARTTLS",
|
||||
EnvVar: "PLUGIN_NO_STARTTLS",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "recipients.file",
|
||||
|
@ -412,7 +412,7 @@ func run(c *cli.Context) error {
|
|||
Username: c.String("username"),
|
||||
Password: c.String("password"),
|
||||
SkipVerify: c.Bool("skip.verify"),
|
||||
StartTLS: c.Bool("starttls"),
|
||||
NoStartTLS: c.Bool("no.starttls"),
|
||||
Recipients: c.StringSlice("recipients"),
|
||||
RecipientsFile: c.String("recipients.file"),
|
||||
RecipientsOnly: c.Bool("recipients.only"),
|
||||
|
|
|
@ -88,7 +88,7 @@ type (
|
|||
Username string
|
||||
Password string
|
||||
SkipVerify bool
|
||||
StartTLS bool
|
||||
NoStartTLS bool
|
||||
Recipients []string
|
||||
RecipientsFile string
|
||||
RecipientsOnly bool
|
||||
|
@ -153,7 +153,7 @@ func (p Plugin) Exec() error {
|
|||
dialer.TLSConfig = &tls.Config{InsecureSkipVerify: true}
|
||||
}
|
||||
|
||||
if !p.Config.StartTLS {
|
||||
if p.Config.NoStartTLS {
|
||||
dialer.StartTLSPolicy = gomail.NoStartTLS
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue