if (!(imap_response[i].bodystructure) || imap_response[i].bodystructure_len <= 0) continue;
/* Search the account id of pbd_event */
+ EM_DEBUG_LOG("Find server_mail_id: [%d]", imap_response[i].uid_no);
for (temp_count = 0; temp_count < item_count && pbd_event[temp_count].server_mail_id != imap_response[i].uid_no; temp_count++)
continue;
if (full_line) p_bodystructure = strcasestr(full_line, "BODYSTRUCTURE");
if (full_line) p_bodystructure_end = strcasestr(full_line, "BODY[TEXT]");
+ if (full_line) p_uid = strcasestr(full_line, "UID");
/* check whether full header is received */
- if (p_bodystructure && p_bodystructure_end) {
+ if (p_bodystructure && p_bodystructure_end && p_uid) {
/* get UID */
- if ((p_uid = strcasestr(full_line, "UID")) != NULL) {
- p_uid = p_uid + strlen("UID ");
- server_response[count].uid_no = atol(p_uid);
- }
+ p_uid = p_uid + strlen("UID ");
+ server_response[count].uid_no = atol(p_uid);
/* get BODYSTRUCTURE */
server_response[count].bodystructure_len = p_bodystructure_end - p_bodystructure;
count++;
p_bodystructure = NULL;
p_bodystructure_end = NULL;
+ p_uid = NULL;
continue;
} else {
/* not a full header, accumulate into buffer util get the end of header */
p_bodystructure = NULL;
p_bodystructure_end = NULL;
+ p_uid = NULL;
continue;
}
}