It will make it into the next product release. In the meantime, here's a patch to GT::Mail::Parts (not that it's not a real patch, so you'll have to change it manually):
# --------------------------------------------------------------------------
my ( $tag, $line ) = @_;
+
+# Remove any newlines that shouldn't be in the header
+ $line =~ s/(?:\r?\n)+$//;
+ $line =~ s/(?:\r?\n)(?=[^\t ])/ /g;
+
+# Don't fold if we don't need to
+ my $fold = 0;
+ for (split /$CRLF/, $line) {
+ if (length $_ > 72) {
+ $fold = 1;
+ last;
+ }
+ }
+ return $line unless $fold;
return $line;
}
-# Line does not need wrapping
- if ( length( $line ) <= 72 ) {
- return $line;
- }
Adrian
Code:
sub fold { # --------------------------------------------------------------------------
my ( $tag, $line ) = @_;
+
+# Remove any newlines that shouldn't be in the header
+ $line =~ s/(?:\r?\n)+$//;
+ $line =~ s/(?:\r?\n)(?=[^\t ])/ /g;
+
+# Don't fold if we don't need to
+ my $fold = 0;
+ for (split /$CRLF/, $line) {
+ if (length $_ > 72) {
+ $fold = 1;
+ last;
+ }
+ }
+ return $line unless $fold;
return $line;
}
-# Line does not need wrapping
- if ( length( $line ) <= 72 ) {
- return $line;
- }
Adrian