Re: Binhex

From: John Rowan Littell (
Date: Tue 04 Sep 2001 - 20:50:24 UTC

  • Next message: Harold Paulson: "Re: Binhex"

            -- 8< -- inline --
    Lo, Bjarni R. Einarsson and the coffee pot sang in unison:
    > On 2001-09-04, 14:52:07 (-0500), John Rowan Littell wrote:
    > > Along the lines of custom extensions, I've been running anomy fairly
    > > happily for a couple of weeks, and most of the problems we're having
    > > are related to BinHex format attachments. I'm considering writing a
    > > BinHex decoder that could either save the attachment in its original
    > > format or keep it in BinHex and keep the MIME type the same. Do you
    > > have any pointers on where to start banging to insert this kind of a
    > > function?
    > Is binhex generally used as an alternate transfer encoding within
    > MIME, or is it more like uuencoded stuff, embedded within text
    > attachments?

    I've seen it most recently in Eudora-sent documents that are encoded
    and then attached as application/mac-binhex40. Looks like the page
    you cite below has the basic info. It is possible to use it embedded
    within text documents, but I don't think that's its most common usage
    these days.

    > Either way, my first impression is that it should definately go
    > into, in some similar way as Base64, Quoted-Printable
    > and UUencode are handled. But, according to:
    > the binhex attachments contains more than just plain data - they
    > also contain metadata (filenames etc.) which it isn't quite clear
    > what the Sanitizer should do with: ignore it or sanitize it?

    Ideally, I guess tht it would decode the filename and scan accordingly
    based on extension, mangling or defanging as appropriate. My
    approach, were I to start this, would be to first just recognize the
    BinHex MIME type and ignore it. Then I'd add the capability of
    decoding the document, and work from there to figure out what to do
    with the document contents and file name. It would probably be nice
    in the end to have the final result re-encode the document.

    > I haven't looked at the format closely, so I can't tell whether
    > binhex is as much of a headache as TNEF. But, there appears to be
    > a CPAN module, "Convert::BinHex" which might provide a good basis
    > for work on the problem.
    > Note though that I came to the conclusion that Convert::TNEF wasn't
    > suitable for the Sanitizer, since it would only allow unpacking,
    > not the seamless "editing" of content that I'm trying to achieve
    > with the Sanitizer...

    I don't know enough about TNEF to compare it. I found the CPAN
    module, and was about to start digging at that. Based on my knowledge
    thus far, it does seem possible that the BinHex format would pose
    similar problems, but I'm not going to wager on that point yet. I'll
    look more closely at both the format and the internals of the


    John "Rowan" Littell
    Systems Administrator
    Earlham College Computing Services

    -- 8< -- inline --

    hosted by