summaryrefslogtreecommitdiffstats
path: root/modules/mailer
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-20 19:12:55 +0800
committerUnknwon <u@gogs.io>2015-08-20 19:12:55 +0800
commitd7c3c79c00425e89a71e6178076bc5828421244d (patch)
treea12b3aa0fdf1500cd5a38438ea912f39616fcfc5 /modules/mailer
parent062adbed8a8a9cb83cd172b5a6e232e75af89f2d (diff)
downloadgitea-d7c3c79c00425e89a71e6178076bc5828421244d.tar.gz
gitea-d7c3c79c00425e89a71e6178076bc5828421244d.zip
minor fix on #1517
Diffstat (limited to 'modules/mailer')
-rw-r--r--modules/mailer/mailer.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go
index 4fbacf2912..ce3ffc270e 100644
--- a/modules/mailer/mailer.go
+++ b/modules/mailer/mailer.go
@@ -12,16 +12,16 @@ import (
"net/smtp"
"os"
"strings"
- "errors"
+
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
)
type loginAuth struct {
- username, password string
+ username, password string
}
-//SMTP AUTH LOGIN Auth Handler
+// SMTP AUTH LOGIN Auth Handler
func LoginAuth(username, password string) smtp.Auth {
return &loginAuth{username, password}
}
@@ -38,7 +38,7 @@ func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) {
case "Password:":
return []byte(a.password), nil
default:
- return nil, errors.New("Unkown fromServer")
+ return nil, fmt.Errorf("unknwon fromServer: %s", string(fromServer))
}
}
return nil, nil
@@ -162,8 +162,8 @@ func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte)
auth = smtp.CRAMMD5Auth(settings.User, settings.Passwd)
} else if strings.Contains(options, "PLAIN") {
auth = smtp.PlainAuth("", settings.User, settings.Passwd, host)
- //Patch for AUTH LOGIN
} else if strings.Contains(options, "LOGIN") {
+ // Patch for AUTH LOGIN
auth = LoginAuth(settings.User, settings.Passwd)
}