1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-10 12:14:25 +00:00

make mailer log more verbose

This commit is contained in:
Unknwon 2015-12-19 02:44:34 -05:00
parent 09c981846b
commit 2d3ecbe5b2
3 changed files with 11 additions and 11 deletions

View File

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.8.10.1217" const APP_VER = "0.8.10.1219"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

View File

@ -111,7 +111,7 @@ func (s *Sender) Send(from string, to []string, msg io.WriterTo) error {
client, err := smtp.NewClient(conn, host) client, err := smtp.NewClient(conn, host)
if err != nil { if err != nil {
return err return fmt.Errorf("NewClient: %v", err)
} }
if !setting.MailService.DisableHelo { if !setting.MailService.DisableHelo {
@ -124,7 +124,7 @@ func (s *Sender) Send(from string, to []string, msg io.WriterTo) error {
} }
if err = client.Hello(hostname); err != nil { if err = client.Hello(hostname); err != nil {
return err return fmt.Errorf("Hello: %v", err)
} }
} }
@ -132,7 +132,7 @@ func (s *Sender) Send(from string, to []string, msg io.WriterTo) error {
hasStartTLS, _ := client.Extension("STARTTLS") hasStartTLS, _ := client.Extension("STARTTLS")
if !isSecureConn && hasStartTLS { if !isSecureConn && hasStartTLS {
if err = client.StartTLS(tlsconfig); err != nil { if err = client.StartTLS(tlsconfig); err != nil {
return err return fmt.Errorf("StartTLS: %v", err)
} }
} }
@ -151,28 +151,28 @@ func (s *Sender) Send(from string, to []string, msg io.WriterTo) error {
if auth != nil { if auth != nil {
if err = client.Auth(auth); err != nil { if err = client.Auth(auth); err != nil {
return err return fmt.Errorf("Auth: %v", err)
} }
} }
} }
if err = client.Mail(from); err != nil { if err = client.Mail(from); err != nil {
return err return fmt.Errorf("Mail: %v", err)
} }
for _, rec := range to { for _, rec := range to {
if err = client.Rcpt(rec); err != nil { if err = client.Rcpt(rec); err != nil {
return err return fmt.Errorf("Rcpt: %v", err)
} }
} }
w, err := client.Data() w, err := client.Data()
if err != nil { if err != nil {
return err return fmt.Errorf("Data: %v", err)
} else if _, err = msg.WriteTo(w); err != nil { } else if _, err = msg.WriteTo(w); err != nil {
return err return fmt.Errorf("WriteTo: %v", err)
} else if err = w.Close(); err != nil { } else if err = w.Close(); err != nil {
return err return fmt.Errorf("Close: %v", err)
} }
return client.Quit() return client.Quit()

View File

@ -1 +1 @@
0.8.10.1217 0.8.10.1219