website: log when SMTP down

Change-Id: I37f9e6f72db04ef48d3e45226f6bd0223e998ed7
This commit is contained in:
mpl 2016-12-15 17:19:30 +01:00
parent b3d21d7faa
commit b211cd72b7
1 changed files with 4 additions and 0 deletions

View File

@ -97,8 +97,12 @@ func emailCommit(dir, hash string) (err error) {
subj = subj[:80]
}
if *smtpServer == "" {
return nil
}
cl, err := smtp.Dial(*smtpServer)
if err != nil {
log.Printf("Error connecting to SMTP server for sending commit e-mail: %v", err)
return
}
defer cl.Quit()