https://bugs.gentoo.org/611142 --- a/qmail-remote.c +++ b/qmail-remote.c @@ -556,6 +556,7 @@ void checkutf8message() if (r == 0) break; if (r == -1) temp_read(); + if (ch == '\n' && !stralloc_cats(&firstpart,"\r")) temp_nomem(); if (!stralloc_append(&firstpart,&ch)) temp_nomem(); if (ch == '\r')