fix(GODT-3132): Do not allow sending on disabled accounts

This commit is contained in:
Leander Beernaert
2023-11-22 13:52:00 +01:00
parent ef183e0758
commit 36f7d9672f
2 changed files with 13 additions and 2 deletions

View File

@ -102,7 +102,7 @@ func (s *Service) smtpSendMail(ctx context.Context, authID string, from string,
}
}
if !fromAddr.Send {
if !fromAddr.Send || fromAddr.Status != proton.AddressStatusEnabled {
s.log.Errorf("Can't send emails on address: %v", fromAddr.Email)
return &ErrCanNotSendOnAddress{address: fromAddr.Email}
}