diff options
author | Unknwon <u@gogs.io> | 2015-12-19 02:44:34 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-19 02:44:34 -0500 |
commit | 2d3ecbe5b2aabe33ae0086dc7ecc79bc0269dc35 (patch) | |
tree | 8f569a31fb4b4abb5e6b1c9b61d55c6198a975f8 /modules/mailer | |
parent | 09c981846b2b80c703d26b17024ec2212b8bac63 (diff) | |
download | gitea-2d3ecbe5b2aabe33ae0086dc7ecc79bc0269dc35.tar.gz gitea-2d3ecbe5b2aabe33ae0086dc7ecc79bc0269dc35.zip |
make mailer log more verbose
Diffstat (limited to 'modules/mailer')
-rw-r--r-- | modules/mailer/mailer.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index 4dbcf1180b..eafe04680a 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -111,7 +111,7 @@ func (s *Sender) Send(from string, to []string, msg io.WriterTo) error { client, err := smtp.NewClient(conn, host) if err != nil { - return err + return fmt.Errorf("NewClient: %v", err) } 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 { - 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") if !isSecureConn && hasStartTLS { 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 err = client.Auth(auth); err != nil { - return err + return fmt.Errorf("Auth: %v", err) } } } if err = client.Mail(from); err != nil { - return err + return fmt.Errorf("Mail: %v", err) } for _, rec := range to { if err = client.Rcpt(rec); err != nil { - return err + return fmt.Errorf("Rcpt: %v", err) } } w, err := client.Data() if err != nil { - return err + return fmt.Errorf("Data: %v", err) } else if _, err = msg.WriteTo(w); err != nil { - return err + return fmt.Errorf("WriteTo: %v", err) } else if err = w.Close(); err != nil { - return err + return fmt.Errorf("Close: %v", err) } return client.Quit() |