diff --git a/config/smtpconf.go b/config/smtpconf.go index 9b5f618914..38cec70d1a 100644 --- a/config/smtpconf.go +++ b/config/smtpconf.go @@ -7,15 +7,16 @@ import ( // SMTPConf is smtp config type SMTPConf struct { - SMTPAddr string `toml:"smtpAddr,omitempty" json:"-"` - SMTPPort string `toml:"smtpPort,omitempty" valid:"port" json:"-"` - User string `toml:"user,omitempty" json:"-"` - Password string `toml:"password,omitempty" json:"-"` - From string `toml:"from,omitempty" json:"-"` - To []string `toml:"to,omitempty" json:"-"` - Cc []string `toml:"cc,omitempty" json:"-"` - SubjectPrefix string `toml:"subjectPrefix,omitempty" json:"-"` - Enabled bool `toml:"-" json:"-"` + SMTPAddr string `toml:"smtpAddr,omitempty" json:"-"` + SMTPPort string `toml:"smtpPort,omitempty" valid:"port" json:"-"` + TLSInsecureSkipVerify bool `toml:"tlsInsecureSkipVerify,omitempty" json:"-"` + User string `toml:"user,omitempty" json:"-"` + Password string `toml:"password,omitempty" json:"-"` + From string `toml:"from,omitempty" json:"-"` + To []string `toml:"to,omitempty" json:"-"` + Cc []string `toml:"cc,omitempty" json:"-"` + SubjectPrefix string `toml:"subjectPrefix,omitempty" json:"-"` + Enabled bool `toml:"-" json:"-"` } func checkEmails(emails []string) (errs []error) { diff --git a/reporter/email.go b/reporter/email.go index 4f9f4fdc21..6c1349d9f8 100644 --- a/reporter/email.go +++ b/reporter/email.go @@ -94,7 +94,8 @@ func (e *emailSender) sendMail(smtpServerAddr, message string) (err error) { emailConf := e.conf //TLS Config tlsConfig := &tls.Config{ - ServerName: emailConf.SMTPAddr, + ServerName: emailConf.SMTPAddr, + InsecureSkipVerify: emailConf.TLSInsecureSkipVerify, } switch emailConf.SMTPPort { case "465": diff --git a/subcmds/discover.go b/subcmds/discover.go index 5bec414a3c..c4f9623b3d 100644 --- a/subcmds/discover.go +++ b/subcmds/discover.go @@ -125,13 +125,14 @@ func printConfigToml(ips []string) (err error) { # https://vuls.io/docs/en/config.toml.html#email-section #[email] -#smtpAddr = "smtp.example.com" -#smtpPort = "587" -#user = "username" -#password = "password" -#from = "from@example.com" -#to = ["to@example.com"] -#cc = ["cc@example.com"] +#smtpAddr = "smtp.example.com" +#smtpPort = "587" +#tlsInsecureSkipVerify = false +#user = "username" +#password = "password" +#from = "from@example.com" +#to = ["to@example.com"] +#cc = ["cc@example.com"] #subjectPrefix = "[vuls]" # https://vuls.io/docs/en/config.toml.html#http-section