fix(mail): add SMTP error to Exception returned by SOGOMailer
parent
24b0408c38
commit
728a006e6e
|
@ -253,8 +253,7 @@
|
|||
|| [login isEqualToString: @"anonymous"]
|
||||
|| ![client plainAuthenticateUser: login
|
||||
withPassword: password])
|
||||
result = [NSException
|
||||
exceptionWithHTTPStatus: 500
|
||||
result = [NSException exceptionWithHTTPStatus: 500
|
||||
reason: @"cannot send message:"
|
||||
@" (smtp) authentication failure"];
|
||||
}
|
||||
|
@ -292,8 +291,7 @@
|
|||
result = [self _sendMailData: mailData withClient: client];
|
||||
}
|
||||
else
|
||||
result = [NSException
|
||||
exceptionWithHTTPStatus: 500
|
||||
result = [NSException exceptionWithHTTPStatus: 500
|
||||
reason: @"cannot send message: (smtp) originator not accepted"];
|
||||
}
|
||||
[client quit];
|
||||
|
@ -302,10 +300,18 @@
|
|||
NS_HANDLER
|
||||
{
|
||||
[self errorWithFormat: @"Could not connect to the SMTP server %@", smtpServer];
|
||||
if ([localException reason])
|
||||
{
|
||||
result = [NSException exceptionWithHTTPStatus: 500
|
||||
reason: [localException reason]];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = [NSException exceptionWithHTTPStatus: 500
|
||||
reason: @"cannot send message:"
|
||||
@" (smtp) error when connecting"];
|
||||
}
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue