From bccd1c5ed758ce326e1fc5b5cc849242b8d2fb2e Mon Sep 17 00:00:00 2001 From: mpl Date: Fri, 30 Sep 2016 16:47:51 +0200 Subject: [PATCH] website/camweb: do not send mail when no smtp Fixes #860 Change-Id: Ic16ec744ba58a929b71cc5f142807a659b47466e --- website/camweb.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/camweb.go b/website/camweb.go index 24a743f14..126def175 100644 --- a/website/camweb.go +++ b/website/camweb.go @@ -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 {