-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't fail on empty part, just return zero length #1621
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -398,6 +398,7 @@ void IMAPSession::init() | |
mRamblerRuServer = false; | ||
mHermesServer = false; | ||
mQipServer = false; | ||
mOutlookServer = false; | ||
mLastFetchedSequenceNumber = 0; | ||
mCurrentFolder = NULL; | ||
pthread_mutex_init(&mIdleLock, NULL); | ||
|
@@ -719,6 +720,7 @@ void IMAPSession::connect(ErrorCode * pError) | |
mRamblerRuServer = (mHostname->locationOfString(MCSTR(".rambler.ru")) != -1); | ||
mHermesServer = (mWelcomeString->locationOfString(MCSTR("Hermes")) != -1); | ||
mQipServer = (mWelcomeString->locationOfString(MCSTR("QIP IMAP server")) != -1); | ||
mOutlookServer = (mHostname->locationOfString(MCSTR(".outlook.com")) != -1); | ||
} | ||
|
||
mState = STATE_CONNECTED; | ||
|
@@ -1989,10 +1991,8 @@ void IMAPSession::expunge(String * folder, ErrorCode * pError) | |
* pError = ErrorNone; | ||
} | ||
|
||
static int | ||
fetch_imap(mailimap * imap, bool identifier_is_uid, uint32_t identifier, | ||
struct mailimap_fetch_type * fetch_type, | ||
char ** result, size_t * result_len) | ||
int IMAPSession::fetch_imap(mailimap * imap, bool identifier_is_uid, uint32_t identifier, | ||
mailimap_fetch_type * fetch_type, char ** result, size_t * result_len) | ||
{ | ||
int r; | ||
struct mailimap_msg_att * msg_att; | ||
|
@@ -2050,8 +2050,14 @@ fetch_imap(mailimap * imap, bool identifier_is_uid, uint32_t identifier, | |
|
||
mailimap_fetch_list_free(fetch_result); | ||
|
||
if (text == NULL) | ||
return MAILIMAP_ERROR_FETCH; | ||
if (text == NULL) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you enable that behavior only if outlook server is detected? |
||
if (mOutlookServer) { | ||
text_length = 0; | ||
} | ||
else { | ||
return MAILIMAP_ERROR_FETCH; | ||
} | ||
} | ||
|
||
* result = text; | ||
* result_len = text_length; | ||
|
@@ -2716,8 +2722,7 @@ Array * IMAPSession::fetchMessagesByNumberWithExtraHeaders(String * folder, IMAP | |
return result; | ||
} | ||
|
||
static int fetch_rfc822(mailimap * session, bool identifier_is_uid, | ||
uint32_t identifier, char ** result, size_t * result_len) | ||
int IMAPSession::fetch_rfc822(mailimap * session, bool identifier_is_uid, uint32_t identifier, char ** result, size_t * result_len) | ||
{ | ||
struct mailimap_section * section; | ||
struct mailimap_fetch_att * fetch_att; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
|
||
#ifdef __cplusplus | ||
|
||
typedef struct mailimap_fetch_type mailimap_fetch_type; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer if that data type wasn't public. |
||
|
||
namespace mailcore { | ||
|
||
extern String * IMAPNamespacePersonal; | ||
|
@@ -273,6 +275,7 @@ namespace mailcore { | |
bool mRamblerRuServer; | ||
bool mHermesServer; | ||
bool mQipServer; | ||
bool mOutlookServer; | ||
|
||
unsigned int mLastFetchedSequenceNumber; | ||
String * mCurrentFolder; | ||
|
@@ -322,6 +325,8 @@ namespace mailcore { | |
bool wholePart, uint32_t offset, uint32_t length, | ||
Encoding encoding, IMAPProgressCallback * progressCallback, ErrorCode * pError); | ||
void storeLabels(String * folder, bool identifier_is_uid, IndexSet * identifiers, IMAPStoreFlagsRequestKind kind, Array * labels, ErrorCode * pError); | ||
int fetch_rfc822(mailimap * session, bool identifier_is_uid, uint32_t identifier, char ** result, size_t * result_len); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are those part of the change? |
||
int fetch_imap(mailimap * imap, bool identifier_is_uid, uint32_t identifier, mailimap_fetch_type * fetch_type, char ** result, size_t * result_len); | ||
}; | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you revert that part?