mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-22 10:06:44 +00:00
fix(GODT-2617): Validate user can send from the SMTP sender address
https://github.com/ProtonMail/go-proton-api/pull/126
This commit is contained in:
@ -97,11 +97,16 @@ func (s *Service) smtpSendMail(ctx context.Context, authID string, from string,
|
||||
from = sender
|
||||
fromAddr, err = s.identityState.GetAddr(from)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Errorf("Failed to get identity from sender address %v", sender)
|
||||
logrus.WithError(err).Errorf("Failed to get identity for from address %v", sender)
|
||||
return ErrInvalidReturnPath
|
||||
}
|
||||
}
|
||||
|
||||
if !fromAddr.Send {
|
||||
s.log.Errorf("Can't send emails on address: %v", fromAddr.Email)
|
||||
return &ErrCanNotSendOnAddress{address: fromAddr.Email}
|
||||
}
|
||||
|
||||
// Load the user's mail settings.
|
||||
settings, err := s.client.GetMailSettings(ctx)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user