diff --git a/src/core/abstract/MCErrorMessage.cpp b/src/core/abstract/MCErrorMessage.cpp index bbe65eb12..2f3d2c983 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 7d7403dac..d1029b138 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 10a6163b9..d0711c65e 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 54648a0f3..419d8485a 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, };