Skip to content

Commit 897b4a2

Browse files
committed
Merge pull request #1343 from serjepatoff/master
2 new error codes
2 parents 1e6ee08 + cd9a226 commit 897b4a2

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

src/core/abstract/MCErrorMessage.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ static const char * localizedDescriptionTable[] = {
4646
"An application specific password is required", /** MCOErrorGmailApplicationSpecificPasswordRequired */
4747
"An error when requesting date", /** MCOErrorServerDate */
4848
"No valid server found", /** MCOErrorNoValidServerFound */
49+
"Error while running custom command", /** MCOErrorCustomCommand */
50+
"Cannot send message due to possible spam detected by server", /** MCOErrorSendMessageSpamSuspected */
51+
"User is over the limit for messages allowed to be sent in a single day", /** MCOErrorSendMessageDailyLimitExceeded */
4952
};
5053

5154
String * mailcore::errorMessageWithErrorCode(ErrorCode errorCode)

src/core/abstract/MCMessageConstants.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ namespace mailcore {
253253
ErrorServerDate,
254254
ErrorNoValidServerFound,
255255
ErrorCustomCommand,
256+
ErrorYahooSendMessageSpamSuspected,
257+
ErrorYahooSendMessageDailyLimitExceeded
256258
};
257259

258260
enum PartType {

src/core/smtp/MCSMTPSession.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,14 @@ void SMTPSession::sendMessage(Address * from, Array * recipients, Data * message
694694
goto err;
695695
}
696696
}
697+
else if (responseCode == 521 && response->locationOfString(MCSTR("over the limit")) != -1) {
698+
* pError = ErrorYahooSendMessageDailyLimitExceeded;
699+
goto err;
700+
}
701+
else if (responseCode == 554 && response->locationOfString(MCSTR("spam")) != -1) {
702+
* pError = ErrorYahooSendMessageSpamSuspected;
703+
goto err;
704+
}
697705

698706
* pError = ErrorSendMessage;
699707
MC_SAFE_REPLACE_COPY(String, mLastSMTPResponse, response);

src/objc/abstract/MCOConstants.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ typedef NS_ENUM(NSInteger, MCOErrorCode) {
413413
MCOErrorNoValidServerFound,
414414
/** Error while running custom command */
415415
MCOErrorCustomCommand,
416+
/** Spam was suspected by server */
417+
MCOErrorYahooSendMessageSpamSuspected,
418+
/** Daily limit of sent messages was hit */
419+
MCOErrorYahooSendMessageDailyLimitExceeded,
416420
/** The count of all errors */
417421
MCOErrorCodeCount,
418422
};

0 commit comments

Comments
 (0)