[dev] MIME.php wrapHeaders corrupting filenames
Michael M Slusarz
slusarz at mail.curecanti.org
Wed Aug 18 21:44:24 PDT 2004
Quoting Samuel Nicolary <sam at nicolary.org>:
> The following function in the MIME framework module is under certain
> circumstances taking long filenames which have spaces in them and
> replacing a space in the filename with a tab:
[snip]
> Here are some examples of how other mailers construct this:
>
> Pine:
> Content-Type: APPLICATION/msword; name="Mid-Pgm Assessment
> Form000000000000000.doc"
> Content-Transfer-Encoding: BASE64
> Content-Disposition: attachment; filename="Mid-Pgm Assessment
> Form000000000000000.doc"
>
> Pine with a filename > 78:
> Content-Type: APPLICATION/msword; name*0="Mid-Pgm Assessment
> Form000000000000000 this is a test and this is another test and th";
> name*1="is is a third test and just one more for kicks.doc"
> Content-Transfer-Encoding: BASE64
> Content-Disposition: attachment; filename*0="Mid-Pgm Assessment
> Form000000000000000 this is a test and this is another test and th";
> filename*1="is is a third test and just one more for kicks.doc"
I've just started to take a look at this, but a quick comment on this
solution.
Although this is the correct way to break these lines according to RFC 2231,
there is a *boatload* of mailers that don't support this. So implementing it
this way is out of the question, at least for right now (IMP, for example,
supports decoding RFC 2231 encoded strings, but we have to do it in an
extremely hackish way as c-client/PHP doesn't even support this format).
Now that I have been thinking about this for a few minutes... isn't this the
same problem and/or potential solution I discussed here:
http://marc.theaimsgroup.com/?l=horde-dev&m=108334367512331&w=2
If this solution doesn't work, most likely we will have to just have
the line be
longer than 78 characters since that is the only way I can see right now that
would work with most/all mailers.
michael
_______________________________________
Michael Slusarz [slusarz at curecanti.org]
More information about the dev
mailing list