mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 18:40:11 +01:00
Improved Message-ID parsing
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
183162ac4a
commit
959b729a6e
13
src/parser.c
13
src/parser.c
@ -417,7 +417,10 @@ int parse_line(char *buf, struct parser_state *state, struct session_data *sdata
|
|||||||
state->message_state = MSG_CC;
|
state->message_state = MSG_CC;
|
||||||
buf += strlen("Bcc:");
|
buf += strlen("Bcc:");
|
||||||
}
|
}
|
||||||
else if(strncasecmp(buf, "Message-Id:", 11) == 0) state->message_state = MSG_MESSAGE_ID;
|
else if(strncasecmp(buf, "Message-Id:", 11) == 0){
|
||||||
|
state->message_state = MSG_MESSAGE_ID;
|
||||||
|
buf += strlen("Message-Id:");
|
||||||
|
}
|
||||||
else if(strncasecmp(buf, "References:", 11) == 0) state->message_state = MSG_REFERENCES;
|
else if(strncasecmp(buf, "References:", 11) == 0) state->message_state = MSG_REFERENCES;
|
||||||
else if(strncasecmp(buf, "Subject:", strlen("Subject:")) == 0){
|
else if(strncasecmp(buf, "Subject:", strlen("Subject:")) == 0){
|
||||||
state->message_state = MSG_SUBJECT;
|
state->message_state = MSG_SUBJECT;
|
||||||
@ -459,11 +462,11 @@ int parse_line(char *buf, struct parser_state *state, struct session_data *sdata
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(state->message_state == MSG_MESSAGE_ID && state->message_id[0] == 0){
|
if(state->message_state == MSG_MESSAGE_ID && state->message_id[0] == 0){
|
||||||
p = strchr(buf+11, ' ');
|
while(isspace(*buf)){
|
||||||
if(p) p = buf + 12;
|
buf++;
|
||||||
else p = buf + 11;
|
}
|
||||||
|
|
||||||
snprintf(state->message_id, SMALLBUFSIZE-1, "%s", p);
|
snprintf(state->message_id, SMALLBUFSIZE-1, "%s", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(state->message_state == MSG_CONTENT_TYPE || state->message_state == MSG_CONTENT_DISPOSITION){
|
if(state->message_state == MSG_CONTENT_TYPE || state->message_state == MSG_CONTENT_DISPOSITION){
|
||||||
|
Loading…
Reference in New Issue
Block a user