forked from Silverfish/proton-bridge
feat(GODT-2502): Additional info.
This commit is contained in:
@ -248,6 +248,7 @@ func run(c *cli.Context) error {
|
||||
"lastVersion": v.GetLastVersion().String(),
|
||||
"showAllMail": v.GetShowAllMail(),
|
||||
"updateCh": v.GetUpdateChannel(),
|
||||
"autoUpdate": v.GetAutoUpdate(),
|
||||
"rollout": v.GetUpdateRollout(),
|
||||
"DoH": v.GetProxyAllowed(),
|
||||
}).Info("Vault loaded")
|
||||
|
||||
@ -23,6 +23,7 @@ import (
|
||||
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/safe"
|
||||
"github.com/emersion/go-smtp"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type smtpBackend struct {
|
||||
@ -85,7 +86,7 @@ func (s *smtpSession) Rcpt(to string) error {
|
||||
}
|
||||
|
||||
func (s *smtpSession) Data(r io.Reader) error {
|
||||
return safe.RLockRet(func() error {
|
||||
err := safe.RLockRet(func() error {
|
||||
user, ok := s.users[s.userID]
|
||||
if !ok {
|
||||
return ErrNoSuchUser
|
||||
@ -93,4 +94,10 @@ func (s *smtpSession) Data(r io.Reader) error {
|
||||
|
||||
return user.SendMail(s.authID, s.from, s.to, r)
|
||||
}, s.usersLock)
|
||||
|
||||
if err != nil {
|
||||
logrus.WithField("pkg", "smtp").WithError(err).Error("Send mail failed.")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
@ -119,6 +119,12 @@ func New(
|
||||
return nil, fmt.Errorf("failed to get labels: %w", err)
|
||||
}
|
||||
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"userID": apiUser.ID,
|
||||
"numAddr": len(apiAddrs),
|
||||
"numLabels": len(apiLabels),
|
||||
}).Info("Creating user object")
|
||||
|
||||
// Create the user object.
|
||||
user := &User{
|
||||
log: logrus.WithField("userID", apiUser.ID),
|
||||
|
||||
Reference in New Issue
Block a user