Subject: | Problem getting Content-Type and dispositionFilename. |
Date: | Thu, 14 Nov 2013 00:37:28 +0100 |
To: | bug-Mail-Box [...] rt.cpan.org |
From: | Claus Jeppesen <claus [...] soonr.com> |
Hi Mail::Box maintainers,
I have an email with an attachment where $SUBJECT happens:
Relevant part of the email source is:
Content-Type: multipart/mixed;
boundary=Apple-Mail-F456E080-E1F2-4159-9A65-88BEAFDC5715
Content-Transfer-Encoding: 7bit
Subject: Very Long Name of a Document.doc
From: claus@soonr.com
Date: Wed, 13 Nov 2013 17:20:09 -0500
To: inbox@soonr.com
Mime-Version: 1.0 (1.0)
X-Mailer: iPhone Mail (11B511)
--Apple-Mail-F456E080-E1F2-4159-9A65-88BEAFDC5715
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: 7bit
--Apple-Mail-F456E080-E1F2-4159-9A65-88BEAFDC5715
Content-Type: application/msword;
name*0="Very Long Name of a Document.d";
name*1=oc
Content-Disposition: attachment;
filename*0="Very Long Name of a Document.d";
filename*1=oc
Content-Transfer-Encoding: base64
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAAFAAAAOAIAAAAAAAAA
...
...
...
--Apple-Mail-F456E080-E1F2-4159-9A65-88BEAFDC5715
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: 7bit
Sent from my iPhone
--Apple-Mail-F456E080-E1F2-4159-9A65-88BEAFDC5715--
Upon recursing over the email - e.g.
foreach my $part ($msg->parts('RECURSE')) {
print $part->body->type(),"\n";
print $part->body->dispositionFilename,"\n";
}
I get:
text/plain; charset=us-ascii
Use of uninitialized value in print at ./test.perl line 210.
application/msword; name*0="Very Long Name of a Document.d";
name*1=oc
Use of uninitialized value in print at ./test.perl line 210.
text/plain; charset=us-ascii
Use of uninitialized value in print at ./test.perl line 210.
As far as I understand the syntax in the header implies that the filename*0
and filename*1
should be collapsed into
filename="Very Long Name of a Document.doc"
(The same goes for the Content-Type).
Thanx,
Claus.
--
*Claus Jeppesen* | Director of Network Servicesclaus@soonr.com | www.soonr.com
c +45 6170 5901