Skip to content
Snippets Groups Projects
Commit 459893f5 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix bug introduced in e9f56e5d - line endings stripped from rx'd mail

An unrelated optimization (elimination of an unnecessary use of fprintf) resulted in a new bug that combined all lines from SMTP-received mail messages into a single long line, thus breaking all decoding ability of multi-part MIME messages (where blank lines are significant).

Went ahead and replaced some other unnecessary uses of fprintf(), replaces with fputs() while at it.
parent 28ad16e0
No related branches found
No related tags found
No related merge requests found
......@@ -4006,7 +4006,7 @@ static void smtp_thread(void* arg)
state=SMTP_STATE_DATA_BODY; /* Null line separates header and body */
lines=0;
if(msgtxt!=NULL) {
fprintf(msgtxt, "\r\n");
fputs("\r\n", msgtxt);
hdr_len=ftell(msgtxt);
}
continue;
......@@ -4016,6 +4016,7 @@ static void smtp_thread(void* arg)
if(*p=='.') p++; /* Transparency (RFC821 4.5.2) */
if(msgtxt!=NULL) {
fputs(p, msgtxt);
fputs("\r\n", msgtxt);
}
lines++;
/* release time-slices every x lines */
......@@ -4044,8 +4045,10 @@ static void smtp_thread(void* arg)
}
}
if(msgtxt!=NULL)
fprintf(msgtxt, "%s\r\n", buf);
if(msgtxt!=NULL) {
fputs(buf, msgtxt);
fputs("\r\n", msgtxt);
}
hdr_lines++;
continue;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment