Skip Menu |

This queue is for tickets about the Mail-Box CPAN distribution.

Report information
The Basics
Id: 114589
Status: resolved
Priority: 0/
Queue: Mail-Box

People
Owner: Nobody in particular
Requestors: randy.diffenderfer [...] gmail.com
Cc:
AdminCc:

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



Subject: Mail::Message::Field attribute issue
Date: Sun, 22 May 2016 15:37:12 -0700
To: bug-Mail-Box [...] rt.cpan.org
From: Randy Diffenderfer <randy.diffenderfer [...] gmail.com>
i'm working off an old version of Mail::Box, so i apologize in advance if this is old news. unfortunately, i'm not in a position to test with the latest. oh well... consider a header line such: Content-Type: text/plain; foo="foo1"; foo="foo2"; foo="foo3" salient feature is the (bogus?) use of multiple attributes with the same name... i haven't rtfrfc to see if this is even legit, but spammers will do anything, so assume it can show up in an email somewhere now let's get the value of attribute foo: $field->attribute( 'foo' ) gets a value of 'foo1' but %attrs = $field->attributes( 'foo' ) $attrs{'foo'} is 'foo3' cute...
Subject: Re: [rt.cpan.org #114589] Mail::Message::Field attribute issue
Date: Mon, 23 May 2016 10:10:54 +0200
To: Randy Diffenderfer via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <mark [...] nluug.nl>
* Randy Diffenderfer via RT (bug-Mail-Box@rt.cpan.org) [160522 22:37]: Show quoted text
> Sun May 22 18:37:20 2016: Request 114589 was acted upon. > Transaction: Ticket created by randy.diffenderfer@gmail.com > Queue: Mail-Box > Subject: Mail::Message::Field attribute issue > Requestors: randy.diffenderfer@gmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=114589 > > > consider a header line such: > Content-Type: text/plain; foo="foo1"; foo="foo2"; foo="foo3" > > salient feature is the (bogus?) use of multiple attributes with the same > name... > > $field->attribute( 'foo' ) > gets a value of 'foo1' > > but > %attrs = $field->attributes( 'foo' ) > $attrs{'foo'} is 'foo3'
It is a good point. I will include a warning about this, and change the example a litte bit. Returned are pairs (key => value), but it does not say that all keys are unique. Your assignment converts it into a hash so looses the other parameters with the same name. If I rememebr correctly, only the first attribute with a certain name counts. The attributes() method is not really useful: the code is more readible when you query for expected parameters. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #114589] Mail::Message::Field attribute issue
Date: Mon, 23 May 2016 01:52:53 -0700
To: bug-Mail-Box [...] rt.cpan.org
From: Randy Diffenderfer <randy.diffenderfer [...] gmail.com>
in this case, that method *is* useful for me -- i use it as a diagnostic to see wth is in the field. we have a current hot malware vector that is genning up some seriously broken mime, and outlook in its infinite silliness ingests it happily and gets owned. sigh... :-) i don't have to push the key-val pairs to a hash -- that's where the data loss happens, as the later ones overwrite the earlier ones. i could walk the array and then do the right thing with duplicates, for some def'n of the right thing. :-) spec is quiet on this point, but does say that "order doesn't matter" for params. On Mon, May 23, 2016 at 1:11 AM, Mark Overmeer via RT < bug-Mail-Box@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=114589 > > > * Randy Diffenderfer via RT (bug-Mail-Box@rt.cpan.org) [160522 22:37]:
> > Sun May 22 18:37:20 2016: Request 114589 was acted upon. > > Transaction: Ticket created by randy.diffenderfer@gmail.com > > Queue: Mail-Box > > Subject: Mail::Message::Field attribute issue > > Requestors: randy.diffenderfer@gmail.com > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=114589 > > > > > consider a header line such: > > Content-Type: text/plain; foo="foo1"; foo="foo2"; foo="foo3" > > > > salient feature is the (bogus?) use of multiple attributes with the same > > name... > > > > $field->attribute( 'foo' ) > > gets a value of 'foo1' > > > > but > > %attrs = $field->attributes( 'foo' ) > > $attrs{'foo'} is 'foo3'
> > It is a good point. I will include a warning about this, and change the > example a litte bit. Returned are pairs (key => value), but it does not > say that all keys are unique. Your assignment converts it into a hash > so looses the other parameters with the same name. > > If I rememebr correctly, only the first attribute with a certain name > counts. The attributes() method is not really useful: the code is > more readible when you query for expected parameters. > -- > Regards, > MarkOv > > ------------------------------------------------------------------------ > Mark Overmeer MSc MARKOV Solutions > Mark@Overmeer.net solutions@overmeer.net > http://Mark.Overmeer.net http://solutions.overmeer.net > > >
Released over a year ago