Skip to content

Commit

Permalink
fix bug determining whether to send emails
Browse files Browse the repository at this point in the history
  • Loading branch information
cdzombak committed Nov 13, 2023
1 parent 7518db2 commit 060befe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ func main() {
mailCfg.mailFrom = os.Getenv(MailFromEnvVar)
}
if mailCfg.mailFrom == "" {
// TODO(cdzombak):
mailCfg.mailFrom = "runner@" + hostname
}
if mailCfg.smtpUser == "" {
Expand All @@ -298,7 +299,7 @@ func main() {
}
}
if mailCfg.mailTo != "" && strings.Contains(mailCfg.mailTo, "@") {
if *smtpUser != "" || *smtpPass != "" || *smtpHost != "" {
if *smtpUser != "" && *smtpPass != "" && *smtpHost != "" {
shouldMailOutput = true

if mailCfg.smtpPort < 1 || mailCfg.smtpPort > 65535 {
Expand Down

0 comments on commit 060befe

Please sign in to comment.