Skip to content

Commit

Permalink
fix email notifications when configured by env var
Browse files Browse the repository at this point in the history
  • Loading branch information
cdzombak committed Nov 28, 2023
1 parent 665aaf7 commit cef9b21
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ func main() {
mailCfg.mailFrom = os.Getenv(MailFromEnvVar)
}
if mailCfg.mailFrom == "" {
// TODO(cdzombak):
mailCfg.mailFrom = "runner@" + hostname
}
if mailCfg.smtpUser == "" {
Expand All @@ -299,7 +298,7 @@ func main() {
}
}
if mailCfg.mailTo != "" && strings.Contains(mailCfg.mailTo, "@") {
if *smtpUser != "" && *smtpPass != "" && *smtpHost != "" {
if mailCfg.smtpUser != "" && mailCfg.smtpPassword != "" && mailCfg.smtpHost != "" {
shouldMailOutput = true

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

0 comments on commit cef9b21

Please sign in to comment.