mikel/mail — pull request #506 by ConradIrwin (2013-02-04 05:34:23+00:00)
Title: Improve handling of backslashes in quoted strings. [Fixes #450]

The relevant part of RFC-822 says that '\' '"' and "\r" should be
escaped in quoted strings.

I have added escaping for '\', but not for '\r' as we already use
quoted-printable form for those (and if we allow raw newlines in headers
we have to be much more careful to avoid header-injection).

I've also fixed unquote() to remove backslash-escaping from the string
as RFC-822 suggests.