Subject: | Extraneous whitespace at end of headers |
The current Mail::Mailer adds whitespace to the end of header lines in _cleanup_hdrs.
This is bad because it screws up other programs which don't expect there to be whitespace there. A good example of a program that breaks is INN. (Whether or not those other programs are broken too is unrelated to this ticket.)
Mail::Mailer shouldn't add whitespace at the end of lines, and in general, its safer to trim whitespace at the end of header lines.
The 1.15 release doesn't have this issue, although there was probably a reason for the change.
Thus, I present the following patch:
--- Mail/Mailer.pm.orig Tue Aug 27 22:22:07 2002
+++ Mail/Mailer.pm Tue Aug 27 22:22:44 2002
@@ -305,6 +305,7 @@
foreach $h (values %$hdrs) {
foreach (ref($h) ? @{$h} : $h) {
s/\n\s*/ /;
+ s/\s*$//o;
}
}
}
It does not revert the code to the 1.15 version, because there must have been a reason for the change, but adds code to trim trailing whitespace off of each element.
Be conservative in what you accept and liberal in what you send.
-R