Subject: | Some lines longer than 76 chars |
I've been looking into why emails that we send out get flagged as
invalid by spamassassin (specifically they fail the MIME_QP_LONG_LINE
test). It seems that in some situations the XS in MIME::QuotedPrint
produces a final line 77 chars long:
[root@mailer02 ~]# perl -MMIME::QuotedPrint -e 'print encode_qp("a" x 76)'
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=
[root@mailer02 ~]# perl -MMIME::QuotedPrint -e 'print encode_qp("a" x 77)'
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=
aa=
However it doesn't always do this:
# perl -MMIME::QuotedPrint -e 'for( 1 .. 500) { $t = encode_qp("a" x (76
* $_)); print "Invalid line length at $_\n" if grep { length > 76 }
split /\n/, $t }'
Invalid line length at 1
Invalid line length at 76
Invalid line length at 151
Invalid line length at 226
Invalid line length at 301
Invalid line length at 376
Invalid line length at 451
Thanks,
Mark