Subject: | change request about Mail/Header.pm. |
Date: | Tue, 16 Jun 2015 11:20:12 +0900 |
To: | <bug-MailTools [...] rt.cpan.org> |
From: | kentarou 中村 健太郎 <kentarou [...] right.jp> |
Dear Developers,
First, I'm Japanese.
I'm not good at English very much.
If there are some not polite or not good expressions, please ask me.
Problem:
When we send e-mail from perl, the below message came.
Show quoted text
> Bad RFC822 field name 'Content-Disposition'
> at /usr/local/share/perl5/MIME/Entity.pm line 642.
Same script worked in our old server, however it doesn't not worked in our new server.
Environment:
OS: Red Hat Enterprise Linux Server release 7.0 (Maipo)
Perl: perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi.
Background:
In UTF-8 environment, the perl regular expression is not understandable for me in new server.
For example...
use encoding 'utf8', STDIN=>'utf8', STDOUT=>'utf8';
$s = "position";
$F = '[^\x00-\x1f\x7f-\xff :]+';
print "no opt:".( $s =~ /^$F$/ )."\n"; # it's match.
print "opt i:".( $s =~ /^$F$/i )."\n"; # it's not match.
When I executed the script in rhel 5.5, perl 5.8.8, both matched.
However I executed the script in rhel 7.0, perl 5.16.3, the last regular expression was not matched.
I expect the regular expression should not be affected with option "i".
Solved-diff:
148c148
< ($tag) = $line =~ /^($FIELD_NAME|From )/oi
---
Show quoted text> ($tag) = $line =~ /^($FIELD_NAME|From )/o
170c170
< defined $ctag && $ctag =~ /^($FIELD_NAME|From )/oi
---
Show quoted text> defined $ctag && $ctag =~ /^($FIELD_NAME|From )/o
273c273
< { my $tag = _tag_case +($ln =~ /^($FIELD_NAME|From )/oi)[0];
---
Show quoted text> { my $tag = _tag_case +($ln =~ /^($FIELD_NAME|From )/o)[0];