Email中的设置为 head only时,只下载邮件头,不下载text部分
0赞[Desription]
将Email中的download option设置为 head only时,只下载邮件头,不下载邮件中的text部分。
[Solution]
1.在文件emailsrvimap4.c中srv_email_imap4_recv_fsm_received函数中修改如下地方:
else if (state_p->download_opt == SRV_EMAIL_DOWNLOAD_HEADER ||
record_p->size > state_p->download_size)
{
msg_header_p->state = SRV_EMAIL_MSG_STATE_HEADER_ONLY;
if (text_cont_p &&text_cont_p->cont.server_size > 0) // change
{
partial_fetch = MMI_TRUE;
msg_header_p->state |= SRV_EMAIL_MSG_STATE_DOWN_NOT_FINISH;
}
else
{
msg_header_p->state = SRV_EMAIL_MSG_STATE_DOWN_ALL;
}
/*
if (state_p->download_opt == SRV_EMAIL_DOWNLOAD_HEADER ||
record_p->size > state_p->download_size)
{
if (text_cont_p && text_cont_p->cont.server_size)
{
state_p->curr_cont_p = text_cont_p;
} }
else
*/
2.在文件emailsrvpop3.c中srv_email_pop3_recv_fsm_received中做如下的修改,
if (state_p->batch_download &&
state_p->fetch_type == EMAIL_PS_FETCH_TYPE_HEADER &&
download_size <= state_p->curr_rec_p->size)
{
/*
retval = srv_email_msg_parse_partial_file(
state_p->msg_handle,
state_p->rsp_filename,
parse_body,
parse_body,
&state_p->req_id);
*/
retval = srv_email_msg_parse_partial_file(
state_p->msg_handle,
state_p->rsp_filename,
MMI_FALSE,
MMI_FALSE,
&state_p->req_id);
}
else
{
retval = srv_email_msg_parse_file(
state_p->msg_handle,
state_p->rsp_filename,
parse_body,
parse_body,
&state_p->req_id);
}
10A版本需做的修改:
对与IMAP4帐号,
在函数srv_email_imap4_recv_fsm_received中
将芯方式如下代码改为
else if (record_p->size > state_p->download_size)
{
if(state_p->cont_size_flag== SRV_EMAIL_MSG_CONT_TEXT_MORE_THAN_2K)
{
msg_header_p->state |= SRV_EMAIL_MSG_STATE_DOWN_NOT_FINISH;
state_p->fetch_type = SRV_EMAIL_IMAP4_FETCH_BODY_STRUCT;
}
Else if (state_p->cont_size_flag==SRV_EMAIL_MSG_CONT_TEXT_LESS_THAN_2K)
{
//msg_header_p->state = SRV_EMAIL_MSG_STATE_HEADER_ONLY;
state_p->fetch_type = SRV_EMAIL_IMAP4_FETCH_BODY_STRUCT;
}
else
{
msg_header_p->state = SRV_EMAIL_MSG_STATE_HEADER_ONLY;//chech it
} }
修改为
else if (record_p->size > state_p->download_size)
{
msg_header_p->state |= SRV_EMAIL_MSG_STATE_DOWN_NOT_FINISH;
msg_header_p->state = SRV_EMAIL_MSG_STATE_HEADER_ONLY;
}
同时将如下代码注释掉
if ((state_p->download_opt == SRV_EMAIL_DOWNLOAD_HEADER ||
record_p->size > state_p->download_size) &&
text_cont_p)
{
state_p->curr_cont_p = text_cont_p;//skyfyx check it again
}
对于POP3icfans帐号,
在函数srv_email_pop3_recv_fsm_received中
if(download_size<state_p->curr_rec_p->size)
{
retval = srv_email_msg_parse_partial_file(
state_p->msg_handle,
state_p->rsp_filename,
parse_body,
parse_body,
&state_p->req_id);
}
else
retval = srv_email_msg_parse_file(
state_p->msg_handle,
state_p->rsp_filename,
parse_body,
parse_body,
&state_p->req_id);
直接改为
if (state_p->batch_download &&
state_p->fetch_type == EMAIL_PS_FETCH_TYPE_HEADER &&
download_size <= state_p->curr_rec_p->size)
{
retval = srv_email_msg_parse_partial_file(
state_p->msg_handle,
state_p->rsp_filename,
MMI_FALSE,
MMI_FALSE,
&state_p->req_id);
}
else
{
retval = srv_email_msg_parse_file(
state_p->msg_handle,
state_p->rsp_filename,
parse_body,
parse_body,
&state_p->req_id);
}