Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-MIME-ContentType CPAN distribution.

Report information
The Basics
Id: 14076
Status: resolved
Priority: 0/
Queue: Email-MIME-ContentType

People
Owner: Nobody in particular
Requestors: pete [...] clueball.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Blank content-type attributes spew warning
Content-Type: text/plain; leads to: Illegal Content-Type parameter at /usr/local/libdata/perl5/site_perl/Email/MIME.pm line 13 http://www.faqs.org/rfcs/rfc1521.html section 4 suggests these are optional. Here's a patch: --- ContentType.pm_old Tue Aug 9 15:42:30 2005 +++ ContentType.pm Tue Aug 9 15:43:07 2005 @@ -39,8 +39,10 @@ s/^;//; s/^\s+// and next; s/\s+$//; - s/^([^$tspecials]+)=// or do { carp "Illegal Content-Type parameter $_"; - return $attribs; }; + s/^([^$tspecials]+)=// or do { + carp "Illegal Content-Type parameter $_" if $_; + return $attribs; + }; my $attribute = lc $1; my $value = _extract_ct_attribute_value(); $attribs->{$attribute} = $value;
On Tue Aug 09 10:47:05 2005, SARGIE wrote: Show quoted text
> Content-Type: text/plain; > > leads to: > > Illegal Content-Type parameter at > /usr/local/libdata/perl5/site_perl/Email/MIME.pm line 13 > > http://www.faqs.org/rfcs/rfc1521.html section 4 suggests these are > optional. Here's a patch:
I believe your reading of the RFC is mistaken. Its augmented BNF for content type is: content := "Content-Type" ":" type "/" subtype *(";" parameter) The *() group means "zero or more," and "parameter" is not qualified. That means, I think, that you must have a parameter if you have a semicolon! I do not believe this is a bug... although allowing laxer parsing is not a bad idea, as an option. -- rjbs
From: pete [...] clueball.com
On Fri Jul 07 00:06:21 2006, RJBS wrote: Show quoted text
> I believe your reading of the RFC is mistaken. Its augmented BNF for > content type is: > > content := "Content-Type" ":" type "/" subtype *(";" parameter) > > The *() group means "zero or more," and "parameter" is not qualified. > That means, I think, that you must have a parameter if you have a semicolon! > > I do not believe this is a bug... although allowing laxer parsing is not > a bad idea, as an option.
OK, fair enough :-) I note that a quick grep of my email for the last few years shows: 17,000 with: Content-Type: text/plain.* 3,000 with: Content-Type: text/plain;$ 1,000 with Content-Type: text/plain$ So this is a common misinterpretation of the spec - could you make it easy to allow it? Thanks +Pete
Resolved in 1.012 with a package variable. Sorry about (a) the delay and (b) the package variable. -- rjbs