|
|
@ -12,7 +12,7 @@ import ( |
|
|
|
"net/smtp" |
|
|
|
"net/smtp" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"errors" |
|
|
|
|
|
|
|
"github.com/gogits/gogs/modules/log" |
|
|
|
"github.com/gogits/gogs/modules/log" |
|
|
|
"github.com/gogits/gogs/modules/setting" |
|
|
|
"github.com/gogits/gogs/modules/setting" |
|
|
|
) |
|
|
|
) |
|
|
@ -38,7 +38,7 @@ func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) { |
|
|
|
case "Password:": |
|
|
|
case "Password:": |
|
|
|
return []byte(a.password), nil |
|
|
|
return []byte(a.password), nil |
|
|
|
default: |
|
|
|
default: |
|
|
|
return nil, errors.New("Unkown fromServer") |
|
|
|
return nil, fmt.Errorf("unknwon fromServer: %s", string(fromServer)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return nil, nil |
|
|
|
return nil, nil |
|
|
@ -162,8 +162,8 @@ func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte) |
|
|
|
auth = smtp.CRAMMD5Auth(settings.User, settings.Passwd) |
|
|
|
auth = smtp.CRAMMD5Auth(settings.User, settings.Passwd) |
|
|
|
} else if strings.Contains(options, "PLAIN") { |
|
|
|
} else if strings.Contains(options, "PLAIN") { |
|
|
|
auth = smtp.PlainAuth("", settings.User, settings.Passwd, host) |
|
|
|
auth = smtp.PlainAuth("", settings.User, settings.Passwd, host) |
|
|
|
//Patch for AUTH LOGIN
|
|
|
|
|
|
|
|
} else if strings.Contains(options, "LOGIN") { |
|
|
|
} else if strings.Contains(options, "LOGIN") { |
|
|
|
|
|
|
|
// Patch for AUTH LOGIN
|
|
|
|
auth = LoginAuth(settings.User, settings.Passwd) |
|
|
|
auth = LoginAuth(settings.User, settings.Passwd) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|