diff options
author | Hoà V. DINH <dinh.viet.hoa@gmail.com> | 2016-02-01 07:22:01 -0800 |
---|---|---|
committer | Hoà V. DINH <dinh.viet.hoa@gmail.com> | 2016-02-01 07:22:01 -0800 |
commit | 897b4a23d27984b06dd2caf441268ef4b6ad9d67 (patch) | |
tree | 02d9d3822c40ae130349394171173aaec9d6a6f1 | |
parent | 1e6ee0892bd85fbcba26d3929da3b536d735c453 (diff) | |
parent | cd9a226a8e2f3ae69e78a5d4e48a55d92fb484fe (diff) |
Merge pull request #1343 from serjepatoff/master
2 new error codes
-rw-r--r-- | src/core/abstract/MCErrorMessage.cpp | 3 | ||||
-rw-r--r-- | src/core/abstract/MCMessageConstants.h | 2 | ||||
-rw-r--r-- | src/core/smtp/MCSMTPSession.cpp | 8 | ||||
-rw-r--r-- | src/objc/abstract/MCOConstants.h | 4 |
4 files changed, 17 insertions, 0 deletions
diff --git a/src/core/abstract/MCErrorMessage.cpp b/src/core/abstract/MCErrorMessage.cpp index bbe65eb1..2f3d2c98 100644 --- a/src/core/abstract/MCErrorMessage.cpp +++ b/src/core/abstract/MCErrorMessage.cpp @@ -46,6 +46,9 @@ static const char * localizedDescriptionTable[] = { "An application specific password is required", /** MCOErrorGmailApplicationSpecificPasswordRequired */ "An error when requesting date", /** MCOErrorServerDate */ "No valid server found", /** MCOErrorNoValidServerFound */ + "Error while running custom command", /** MCOErrorCustomCommand */ + "Cannot send message due to possible spam detected by server", /** MCOErrorSendMessageSpamSuspected */ + "User is over the limit for messages allowed to be sent in a single day", /** MCOErrorSendMessageDailyLimitExceeded */ }; String * mailcore::errorMessageWithErrorCode(ErrorCode errorCode) diff --git a/src/core/abstract/MCMessageConstants.h b/src/core/abstract/MCMessageConstants.h index 7d7403da..d1029b13 100644 --- a/src/core/abstract/MCMessageConstants.h +++ b/src/core/abstract/MCMessageConstants.h @@ -253,6 +253,8 @@ namespace mailcore { ErrorServerDate, ErrorNoValidServerFound, ErrorCustomCommand, + ErrorYahooSendMessageSpamSuspected, + ErrorYahooSendMessageDailyLimitExceeded }; enum PartType { diff --git a/src/core/smtp/MCSMTPSession.cpp b/src/core/smtp/MCSMTPSession.cpp index 10a6163b..d0711c65 100644 --- a/src/core/smtp/MCSMTPSession.cpp +++ b/src/core/smtp/MCSMTPSession.cpp @@ -694,6 +694,14 @@ void SMTPSession::sendMessage(Address * from, Array * recipients, Data * message goto err; } } + else if (responseCode == 521 && response->locationOfString(MCSTR("over the limit")) != -1) { + * pError = ErrorYahooSendMessageDailyLimitExceeded; + goto err; + } + else if (responseCode == 554 && response->locationOfString(MCSTR("spam")) != -1) { + * pError = ErrorYahooSendMessageSpamSuspected; + goto err; + } * pError = ErrorSendMessage; MC_SAFE_REPLACE_COPY(String, mLastSMTPResponse, response); diff --git a/src/objc/abstract/MCOConstants.h b/src/objc/abstract/MCOConstants.h index 54648a0f..419d8485 100644 --- a/src/objc/abstract/MCOConstants.h +++ b/src/objc/abstract/MCOConstants.h @@ -413,6 +413,10 @@ typedef NS_ENUM(NSInteger, MCOErrorCode) { MCOErrorNoValidServerFound, /** Error while running custom command */ MCOErrorCustomCommand, + /** Spam was suspected by server */ + MCOErrorYahooSendMessageSpamSuspected, + /** Daily limit of sent messages was hit */ + MCOErrorYahooSendMessageDailyLimitExceeded, /** The count of all errors */ MCOErrorCodeCount, }; |