Patch by Zarafa <http://www.zarafa.com/> - this patch makes sure that vmime does not parse trailing spaces on an header. Otherwise vmime will throw an exception and a fallback delivery will be started. It includes a patch when then last header does not end with \n; fixes read receipt e-mails. --- libvmime-0.7.1/src/headerField.cpp 2005-03-18 22:26:47.000000000 +0100 +++ libvmime-0.7.1/src/headerField.cpp.strip-header-endspaces-and-end 2010-02-15 21:38:37.000000000 +0100 @@ -190,6 +190,19 @@ } } + if (pos == end && contentsEnd == 0) { + // end of data, and an enter was not found at the end + contentsEnd = end; + } else { + // strip spaces from end of header lines, also through continuation headers + contentsEnd--; // original enter + while (contentsEnd>contentsStart && + (buffer[contentsEnd] == ' ' || buffer[contentsEnd] == '\t' || + buffer[contentsEnd] == '\r' || buffer[contentsEnd] == '\n')) + contentsEnd--; + contentsEnd++; // new 'enter' + } + // Return a new field headerField* field = headerFieldFactory::getInstance()->create(name);