The above is a bit stricter than the latest commit by Lars: SP and HTAB can occur before a CRLF and there can only be one SP or HTAB on the next line. I am not entirely sure how end-of-line works here cross-platform and whether the string will still use the convention of the message format or the local convention on the receiving end, so [\r\n]+ seems the safest. The fix Lars submitted is more lenient and I am OK with that one too, of course. I just felt since I made the original contribution, it is my responsibility to offer a fix as well. I also updated the tests accordingly. Please note that this implementation /will/ fail a whitespace if it isn't followed by an end-of-line. While updating that test, I cleaned up the other ones a bit.