Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit dd121bcf authored by Rob Swindell's avatar Rob Swindell 💬

Fix bug introduced in c90ba307 - 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 d802a7c9
Pipeline #1179 passed with stage
in 17 minutes and 58 seconds
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment