Hi,
> "Fixing" PDF files will "break" other files. It is simply inappropriate to
> transmit PDF files using Quoted-Printable encoding, and any software that
> does so deserves to have its PDF attachments broken.
That's not true. Look at the workaround itself:
Only real PDF files get converted, the first line must match the
'%PDF' pattern.
For all other files we use decode_qp() patch.
I really hope that you don't reject this patch ! It doesn't break anything.
Martin
--- lib/MIME/Decoder/QuotedPrint.pm.orig Tue Aug 31 17:02:43 2004
+++ lib/MIME/Decoder/QuotedPrint.pm Tue Aug 31 17:02:38 2004
@@ -85,9 +85,26 @@
#
sub decode_it {
my ($self, $in, $out) = @_;
+ my $init = 0;
+ my $havepdf = 0;
while (defined($_ = $in->getline)) {
- $out->print(decode_qp($_));
+ if (!$init) {
+ if ($_ =~ /^%PDF/) {
+ $init = 1;
+ $havepdf = 1;
+ }
+ }
+ if ($havepdf) {
+ my $output = $_;
+ $output =~ s/[ \t]+?(\r?\n)/$1/g; # rule #3 (trailing space must be
deleted)
+ $output =~ s/=\r?\n//g; # rule #5 (soft line breaks)
+ $output =~ s/(^|[^\r])\n\Z/$1\r\n/; # JKF rule to replace trailing \n
with \r\n
+ $output =~ s/=([\da-fA-F]{2})/pack("C", hex($1))/ge;
+ $out->print($output);
+ } else {
+ $out->print(decode_qp($_));
+ }
}
1;
}
_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang