RE: octet-stream attachment

From: Paul Haldane <Paul.Haldane_at_newcastle.ac.uk_at_hypermail-project.org>
Date: Fri, 30 Jul 1999 09:57:12 +0100 (GMT)
Message-ID: <Pine.GSO.3.95-960729.990730094843.17743B-100000_at_carr6.ncl.ac.uk>


> I still haven't captured a message such that I can examine it before the
> fact, but I have three views:
> 1) hypermail v2a23
> 2) hypermail v1.02+ (local)
> 3) Outlook98
>

If you can look at the message in Outlook, can't you just forward it to an account on a Unix box so that we can see the mime headers properly?

> The latter two say the attachments had names ending in .jpg and .pdf (the
> two aberrant examples I've seen). The first says they were ".jpg_" and
> ".pdf_".

> Daniel says:
> > Hypermail saves the file with the name it got supplied. If
> > the file name had a ".jpg_" extension it will be used.
>
> V2a23 is most certainly prepending "att-" to the attachment name. And
> parse.c defines "REPLACEMENT_CHAR" as '_', "to replace invalid characters
> in supplied attachment filenames." Seems like an EOL mishandling, as Paul
> Haldane suggested earlier.
>
> But his proposed fix:
> RCS file: /cvs/hypermail/hypermail/src/parse.c,v
> retrieving revision 1.20
> diff -r1.20 parse.c
> 1222c1222
> < sscanf(fname, "%128[^\"]", attachname);
> ---
> > sscanf(fname, "%128[^\"\n]", attachname);
>
> did not do the trick.

Worked for me - but I was guessing at the format of the name= line.

> I looked at the "safe_filename" function in that
> file, and the other sscanf statements... I notice one suggestive comment,
>
> /* we could've done this with a %n in the sscanf, but we know all
> sscanfs don't grok that */

Nope - %n means return a count of characters read so far (at least on my system) - no relevant.

> Someone more conversant with parse.c and the parsemail() function where the
> above sscanf is can probably track this down from these clues.

Until we see the mime headers of one of the messages, we're just guessing. We can be sure that the last character is outside the set a-zA-Z0-9:_.- (since that's what safe_filename uses as a set of 'safe' characters) but can't really tell any more that that.

A test message from Notes with an attachment is what we need.

Paul Received on Fri 30 Jul 1999 10:57:02 AM GMT

This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:11 AM GMT GMT