Skip to content

Commit

Permalink
fix(mail): add SMTP error to Exception returned by SOGOMailer
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed Sep 14, 2020
1 parent 24b0408 commit 728a006
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions SoObjects/SOGo/SOGoMailer.m
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,9 @@ - (NSException *) _smtpSendData: (NSData *) mailData
|| [login isEqualToString: @"anonymous"]
|| ![client plainAuthenticateUser: login
withPassword: password])
result = [NSException
exceptionWithHTTPStatus: 500
reason: @"cannot send message:"
@" (smtp) authentication failure"];
result = [NSException exceptionWithHTTPStatus: 500
reason: @"cannot send message:"
@" (smtp) authentication failure"];
}
else if (authenticationType)
result = [NSException
Expand Down Expand Up @@ -292,19 +291,26 @@ - (NSException *) _smtpSendData: (NSData *) mailData
result = [self _sendMailData: mailData withClient: client];
}
else
result = [NSException
exceptionWithHTTPStatus: 500
reason: @"cannot send message: (smtp) originator not accepted"];
result = [NSException exceptionWithHTTPStatus: 500
reason: @"cannot send message: (smtp) originator not accepted"];
}
[client quit];
[client disconnect];
}
NS_HANDLER
{
[self errorWithFormat: @"Could not connect to the SMTP server %@", smtpServer];
result = [NSException exceptionWithHTTPStatus: 500
reason: @"cannot send message:"
@" (smtp) error when connecting"];
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;

Expand Down

0 comments on commit 728a006

Please sign in to comment.