[imp] Problems on forwarding mail with attachment (filename mangling)

Andreas Geesen ag at netside.de
Mon Nov 28 08:33:05 PST 2005


Since nobody seems to have (had) a similar problem i tried to figure out
what happens on forwarding an email with an attachment whose name
contains special characters - that means the filename needs to be
encoded in 'ISO-8859-15'. The source-view of the message to be forwarded
shows the filename is encoded already that way.
In "compose.php" the forwarded message is taken and completely copied
into the contents of a new message. The function 'attachFilesFromMessage'
is responsible for copying the all attachments by iterating through
every attachment and calling 'addMIMEPartAttachment' for every suitable
attachment. Within that function 'addMIMEPartAttachment' i lost track on
how the filename of the attachment is getting decoded or maybe its not
decoded. Maybe this part resides in 'transferDecodeContents' but i am
not sure now.
All i know is that on sending the forwarded message the filename is
corrupted already. Looks like its encoded twice. While building the
message to be handed over to sendmail i followed the process up to the
function 'buildAllAttachments'. Inside that function the attachments
turn out to be in a construct '$this->_cache' and every filename i get
from '$part->getName(true)' is corrupted already.

Now my hot guess is that the filename needs to be decoded before being
written into that '_cache'. Is anyone here who has deeper insight into
imps internals? If anyone thinks this is a 'dev' thing that needs to be
posted there please pass me a short note. I dont want to bother devs
unless really necessary.

Regards
Andreas

Andreas Geesen schrieb:

>Hi all! Nice to be here
>
>I searched the archive of this list already on my problem, but havent
>found anything similar though bug #1300 might have had something to do
>with it. Since i've got the actual version of IMP (V 4.0.4 and HORDE
>3.0.6) bug #1300 should have been solved.
>
>Now for the facts....
>
>I received an email with an attachment. The name of the attachment
>contains special characters (german umlauts like ä ö ü - you know) which
>display absolutely correct since the default charset is iso-8859-15. But
>now i take this email and forward it to a friend whose inbox is on the
>same HORDE/IMP server and no matter of choice wether to forward the
>attachment inline or as attachment the filename is totally screwed when
>he reads the email.
>
>I found out when looking into my sent-mail-Folder that the filename gets
>scrambled on forwarding since the notice about the removed attachment in
>the forwarded email shows the same scrambled filename.
>A short test by forwarding to an external email-Adress (gmx Mailbox)
>shows the same result: scrambled filename.
>
>I peeked into the sources of the received and the forwarded email. Both
>filenames are marked as iso-8859-15 but thats the only common thing. As
>you can see 'ö' seems to be invulnerable while 'ä' and 'ü' get messed with.
>
>Right display: "Liste-Hermann_Schräder_(Büromöbel)_#2005-10-26.pdf <#>"
>
>=?iso-8859-15?b?TGlzdGUtSGVybWFubl9TY2hy5GRlcl8oQvxybw==?= =?iso-8859-15?b?bfZiZWwpXyMyMDA1LTEwLTI2LnBkZg==?=
>
>
>Scrambled display: "Liste-Hermann_SchrÃ-der_(BÃ-romöbel)_#2005-10-26.pdf"
>
>=?iso-8859-15?b?TGlzdGUtSGVybWFubl9TY2hywz9kZXJfKELDPw==?= =?iso-8859-15?b?cm9tw7ZiZWwpXyMyMDA1LTEwLTI2LnBkZg==?=
>
>
>
>Anyone with any good ideas? Should i try UTF-8 instead of iso-8859-15?
>Is it a bug in IMP or a config-thing?
>
>Any comments welcome
>
>Best regards
>Andreas
>
>  
>

-- 
mit freundlichem Gruß


Andreas Geesen

NETSIDE ONLINE SERVICE
Abteilung Softwareentwicklung

Tel: 02562 93980
Fax: 02562 939811

ag at netside.de
www.netside.de



More information about the imp mailing list