forked from Silverfish/proton-bridge
feat(GODT-3185): report cases which leads to wrong address key used
This commit is contained in:
@ -27,14 +27,14 @@ var ErrInvalidReturnPath = errors.New("invalid return path")
|
||||
var ErrNoSuchUser = errors.New("no such user")
|
||||
var ErrTooManyErrors = errors.New("too many failed requests, please try again later")
|
||||
|
||||
type ErrCanNotSendOnAddress struct {
|
||||
type ErrCannotSendFromAddress struct {
|
||||
address string
|
||||
}
|
||||
|
||||
func NewErrCanNotSendOnAddress(address string) *ErrCanNotSendOnAddress {
|
||||
return &ErrCanNotSendOnAddress{address: address}
|
||||
func NewErrCannotSendFromAddress(address string) *ErrCannotSendFromAddress {
|
||||
return &ErrCannotSendFromAddress{address: address}
|
||||
}
|
||||
|
||||
func (e ErrCanNotSendOnAddress) Error() string {
|
||||
return fmt.Sprintf("can't send on address: %v", e.address)
|
||||
func (e ErrCannotSendFromAddress) Error() string {
|
||||
return fmt.Sprintf("cannot send from address: %v", e.address)
|
||||
}
|
||||
|
||||
@ -103,8 +103,8 @@ func (s *Service) smtpSendMail(ctx context.Context, authID string, from string,
|
||||
}
|
||||
|
||||
if !fromAddr.Send || fromAddr.Status != proton.AddressStatusEnabled {
|
||||
s.log.Errorf("Can't send emails on address: %v", fromAddr.Email)
|
||||
return &ErrCanNotSendOnAddress{address: fromAddr.Email}
|
||||
s.log.Errorf("Cannot send emails from address: %v", fromAddr.Email)
|
||||
return &ErrCannotSendFromAddress{address: fromAddr.Email}
|
||||
}
|
||||
|
||||
// Load the user's mail settings.
|
||||
|
||||
Reference in New Issue
Block a user