By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,400 Members | 903 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,400 IT Pros & Developers. It's quick & easy.

email.get_filename() with newline

P: n/a
Hi,

if I use part.get_filename() with the following email part:

------_=_NextPart_001_01C81B11.52AB8006
Content-Type: application/vnd.ms-excel;
name="=?iso-8859-1?Q?30102007=28aktualisiert=29=5FK=FCndigungen_env iaM=5FErdgas?=
=?iso-8859-1?Q?_S=FCds__GmbH=2Exls?="
Content-Disposition: attachment;
filename="=?iso-8859-1?Q?30102007=28aktualisiert=29=5FK=FCndigungen_env iaM=5FErdgas?=
=?iso-8859-1?Q?_S=FCds__GmbH=2Exls?="
Content-Description: =?iso-8859-1?Q?30102007=28aktualisiert=29=5FK=FCndigungen_env iaM=5FErdgas?=
=?iso-8859-1?Q?_S=FCds__GmbH=2Exls?=
Content-Transfer-Encoding: base64

0M8R4KGxGu...

I get a filename which includes a newline character and the ?iso... encoding
is not resolved. But the mail user agent "mutt" does display the filename
correct. I tried it with the latest email packages (4.0.2).

Any hints how to parse this filename?

Thomas
Nov 9 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
En Fri, 09 Nov 2007 10:46:15 -0300, Thomas Guettler <hv@tbz-pariv.de>
escribi�:
if I use part.get_filename() with the following email part:

------_=_NextPart_001_01C81B11.52AB8006
Content-Type: application/vnd.ms-excel;
name="=?iso-8859-1?Q?30102007=28aktualisiert=29=5FK=FCndigungen_env iaM=5FErdgas?=
=?iso-8859-1?Q?_S=FCds__GmbH=2Exls?="
Content-Disposition: attachment;
filename="=?iso-8859-1?Q?30102007=28aktualisiert=29=5FK=FCndigungen_env iaM=5FErdgas?=
=?iso-8859-1?Q?_S=FCds__GmbH=2Exls?="
Content-Description:
=?iso-8859-1?Q?30102007=28aktualisiert=29=5FK=FCndigungen_env iaM=5FErdgas?=
=?iso-8859-1?Q?_S=FCds__GmbH=2Exls?=
Content-Transfer-Encoding: base64

0M8R4KGxGu...

I get a filename which includes a newline character and the ?iso...
encoding
is not resolved. But the mail user agent "mutt" does display the filename
correct. I tried it with the latest email packages (4.0.2).
According to RFC2047, section 5:

+ An 'encoded-word' MUST NOT appear within a 'quoted-string'.

+ An 'encoded-word' MUST NOT be used in parameter of a MIME
Content-Type or Content-Disposition field, or in any structured
field body except within a 'comment' or 'phrase'.

so the above headers are invalid.
Any hints how to parse this filename?
You may try joining the lines and unfolding them by hand, and perhaps then
you could convince the decode_header function to work in this case...

--
Gabriel Genellina

Nov 12 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.