cancel
Showing results for 
Search instead for 
Did you mean: 

decoding

SOLVED
Go to solution
Fred Martin_1
Valued Contributor

decoding

I am writing a program that will look into a sendmail inbox on our server, and process an email there.

As it turns out, the email has an attachment that I will need to decode. Header info follows.

Is this something that I can decode with tools that already come on HP-UX 11?

--=_BlatBoundary-dhVhQohGvxaO3fshIlRh4
Content-Type: application/vnd.ms-excel;
name="3253_ORD.XLS"
Content-Disposition: ATTACHMENT;
filename="3253_ORD.XLS"
Content-Transfer-Encoding: base64

VElUTEUJT3JkZXIJTGluZSAgICAgICAJUm91dGUvTW9kZWwJRGVhbGVyL0Rlc2MJQ3VzdG9t
ZXIvQ29sb3IJT3JkZXIgVHlwZSAJT3JkZXIgRGF0ZSAJUHJvbSBEYXRlICAJVG90IFF0eSAg
.....data continues......
fmartin@applicatorssales.com
13 REPLIES
Fred Martin_1
Valued Contributor

Re: decoding

I should add that this is not actually an Excel file, it is comma-delimited text data that is named with an XLS extension.
Fred
fmartin@applicatorssales.com
James R. Ferguson
Acclaimed Contributor
Solution

Re: decoding

Hi Fred:

Have a look at 'uuencode' :

http://docs.hp.com/en/B2355-60130/uuencode.1.html

Regards!

...JRF...
Fred Martin_1
Valued Contributor

Re: decoding

Interesting - the doc you point to has an option -m, relates to base64 - but my man page for uuencode or uudecode doesn't mention that option at all. Perhaps I'm out of date?
Fred
fmartin@applicatorssales.com
Steven Schweda
Honored Contributor

Re: decoding

> Have a look at 'uuencode' :

That'd be uu_de_code, but, ...

> [...] but my man page for uuencode or
> uudecode doesn't mention [...]

Many people who frequent this forum seem to
prefer/promote uuencode for creating e-mail
with attachments, so tend to see it (or
uudecode) as _the_ scheme for dealing with
e-mail attachments. I don't understand why,
but it seems to be true. (It's not MIME,
and so it relies on the receiver being able
to cope with its obsolete scheme.)

I tend to suggest mpack (/munpack) for doing
this kind of thing, because it does MIME,
which is what you have here. Google should
be able to locate a source kit for mpack, or
someone may already have a suitable depot
somewhere. It may also be possible to find
a loose base64 encoder/decoder, but that
might demand much more fooling around to
strip off the headers and separate the
pieces.

I don't do much with this stuff, but I did
manage to build an mpack kit on my main (VMS)
system. As I recall, I started with a Debian
GNU/Linux source kit. My notes say:

ftp://ftp.andrew.cmu.edu/pub/mpack/
http://ftp.de.debian.org/debian/pool/main/m/mpack/mpack_1.6-5.diff.gz
James R. Ferguson
Acclaimed Contributor

Re: decoding

Hi (again) Fred:

It appears that the '-m' option of 'uuencode'/'uudecode' appears at 11.31. At least there is no mention of it in the 11.23 manpages (or earlier).

Regards!

...JRF...
Fred Martin_1
Valued Contributor

Re: decoding

I am stuck with the format as provided; that is, I can't get the sender to modify what they're doing.

Regarding -m option, then maybe there's hope. I'll see if I can patch it up on my system.

Thanks folks.
fmartin@applicatorssales.com
Steven Schweda
Honored Contributor

Re: decoding

Re: mpack

It's seriously under-tested, so no bets, but
there's an mpack source kit under here:

http://antinode.info/dec/sw/mpack.html

If nothing else, the build was clean on an
11.31 (ia64) system, using either the bundled
HP C compiler or GCC. (And munpack did seem
to unpack an old message I had lying around.
I didn't try mpack, but what could go wrong?)


> [...] tools that already come on HP-UX 11?

Actual "uname -a" output is often more
helpful than a vague and imprecise
description.

> Perhaps I'm out of date?

From "11", who can tell?
Dennis Handly
Acclaimed Contributor

Re: decoding

>Is this something that I can decode with tools that already come on HP-UX 11?

Years ago, 1994, I got a tool called mimencode that I use. Not sure where?

mr google finds:
http://examples.oreilly.com/9780596003302/

And there is a tarfile under metamail.
Fred Martin_1
Valued Contributor

Re: decoding

# uname -a
HP-UX corp B.11.11 U 9000/800 132931597 unlimited-user license
fmartin@applicatorssales.com
Fred Martin_1
Valued Contributor

Re: decoding

The patches that I see that seem to be related are PHCO_32167 and/or PHSS_32127. There's nothing in the notes that indicates that they'll actually add the -m switch, though. Does anyone know if I'm on the right track?
fmartin@applicatorssales.com
Dennis Handly
Acclaimed Contributor

Re: decoding

>The patches that I see that seem to be related are PHCO_32167 and/or PHSS_32127. There's nothing in the notes that indicates that they'll actually add the -m switch

Right, PHCO_32167 doesn't list this feature and is the last patch.

>Does anyone know if I'm on the right track?

It doesn't look like it, PHSS_32127 is for OpenMail.
Steven Schweda
Honored Contributor

Re: decoding

> [...] the build was clean on an
> 11.31 (ia64) system, using either the bundled
> HP C compiler or GCC. [...]

> HP-UX corp B.11.11 U 9000/800 132931597 unlimited-user license

On 11.11, you'd need something better than
the PA-RISC bundled C compiler. (Or a lot of
editing.) GCC worked for me, and I assume
that the real HP compiler would work, too,
but I can't easily try it.
Fred Martin_1
Valued Contributor

Re: decoding

Thanks folks. For this particular project I've asked the sender to deliver the attachment using a different method to avoid this issue. Rather than try to correct the specific decoding problem, I'll wait for an OS upgrade for which we are due.
fmartin@applicatorssales.com