website/camweb: do not send mail when no smtp

Fixes #860

Change-Id: Ic16ec744ba58a929b71cc5f142807a659b47466e
This commit is contained in:
mpl 2016-09-30 16:47:51 +02:00
parent 3e1edc18d1
commit bccd1c5ed7
1 changed files with 4 additions and 0 deletions

View File

@ -685,6 +685,9 @@ func runDemoBlobserverLoop() {
}
func sendStartingEmail() {
if *smtpServer == "" {
return
}
contentRev, err := exec.Command("docker", "run",
"--rm",
"-v", "/var/camweb:/var/camweb",
@ -696,6 +699,7 @@ func sendStartingEmail() {
cl, err := smtp.Dial(*smtpServer)
if err != nil {
log.Printf("Failed to connect to SMTP server: %v", err)
return
}
defer cl.Quit()
if err = cl.Mail("noreply@camlistore.org"); err != nil {