From 2f1369c6147b51d0c5f82a3d236d69ac100ef8e8 Mon Sep 17 00:00:00 2001 From: Gogs Date: Fri, 20 Feb 2015 10:12:27 +0300 Subject: [PATCH] add error for hello func --- modules/mailer/mailer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index 57400e73fc2..fc6ec2fa867 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -100,7 +100,10 @@ func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte) if err != nil { return err } - client.Hello(hostname) + + if err = client.Hello(hostname); err != nil { + return err + } // If not using SMTPS, alway use STARTTLS if available hasStartTLS, _ := client.Extension("STARTTLS")