Discussion:
howto un-encode files from email text encoding??
David C. Rankin
2008-10-01 05:14:03 UTC
Permalink
Listmates,

I have had a number of occasions where colleagues have bungled attachments to
e-mail where I receive the message body and attachment all run-together in the
body of the message. Often times I need to be able to un-encode and save the
encoded spreadsheet, word processing document or photo back to its .doc, .xls
or .jpg native file format. The encodings appear similar to:

------=_NextPart_000_0036_01C91E59.83DAB180
Content-Type: application/msword;
name="PETITION - Original.doc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="PETITION - Original.doc"

0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAATwAAAAAAAAAA
EAAAUQAAAAEAAAD+////AAAAAE4AAAD/////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
<snip>
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

_OR_

PHOTO;ENCODING=b;TYPE=image/jpeg:/9j/4AAQSkZJRgABAQIAAAAAAAD/2wBDAAEBAQEBAQ
EBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA
QH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB

_OR_

------=_NextPart_000_0036_01C91E59.83DAB180
Content-Type: application/pdf;
name="spider bite case.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="spider bite case.pdf"

JVBERi0xLjQNCiXi48/TDQo2NyAwIG9iag0KPDwNCi9MaW5lYXJpemVkIDENCi9MIDEyNzYzMCAg
ICANCi9IIFsgNjkzIDgyOCAgICAgICAgICAgICAgXQ0KL08gNjkNCi9FIDU2OTk2ICAgICANCi9O
<snip>
aWxlcg0KPDwNCi9TaXplIDY3DQovSUQgWzwyOGJmNGU1ZTRlNzU4YTQxNjQwMDRlNTZmZmZhMDEw
OD48MjhiZjRlNWU0ZTc1OGE0MTY0MDA0ZTU2ZmZmYTAxMDg+XQ0KPj4NCnN0YXJ0eHJlZg0KMTQ2
DQolJUVPRg==

------=_NextPart_000_0036_01C91E59.83DAB180--


Years ago, there was an old uuencode/uudecode script that I recall using in
DOS, but I don't have anything similar in my Linux tool box yet. I'm sure it is
there, I just don't know what it is called or what it looks like. If somebody
could point me in the right direction, I would appreciate it. Thanks!
--
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Andrew Joakimsen
2008-10-01 05:38:36 UTC
Permalink
On Wed, Oct 1, 2008 at 1:14 AM, David C. Rankin
Post by David C. Rankin
I have had a number of occasions where colleagues have bungled attachments to
e-mail where I receive the message body and attachment all run-together in the
body of the message. Often times I need to be able to un-encode and save the
encoded spreadsheet, word processing document or photo back to its .doc, .xls
Just out of curiosity, what email client do you use? I use Evolution
with an Exchange server and everything works great, attachments are
decoded always without a problem. Also I use Kmail (with a POP3) for
another account and it never does that, FWIW.
Post by David C. Rankin
Content-Transfer-Encoding: base64
<snip>
Years ago, there was an old uuencode/uudecode script that I recall using in
DOS, but I don't have anything similar in my Linux tool box yet. I'm sure it is
there, I just don't know what it is called or what it looks like. If somebody
could point me in the right direction, I would appreciate it. Thanks!
As you can see there the encoding is base64. The command is "base64
-d" to un-encode ([d]ecode). uudecode and uuencode are also there. I'm
not sure what package provides them but im pretty sure its part of
enhanced basesystem.
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
G T Smith
2008-10-01 07:23:41 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by David C. Rankin
Listmates,
I have had a number of occasions where colleagues have bungled attachments to
e-mail where I receive the message body and attachment all run-together in the
body of the message. Often times I need to be able to un-encode and save the
encoded spreadsheet, word processing document or photo back to its .doc, .xls
------=_NextPart_000_0036_01C91E59.83DAB180
Content-Type: application/msword;
name="PETITION - Original.doc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="PETITION - Original.doc"
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAATwAAAAAAAAAA
EAAAUQAAAAEAAAD+////AAAAAE4AAAD/////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
<snip>
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
_OR_
PHOTO;ENCODING=b;TYPE=image/jpeg:/9j/4AAQSkZJRgABAQIAAAAAAAD/2wBDAAEBAQEBAQ
EBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA
QH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB
_OR_
------=_NextPart_000_0036_01C91E59.83DAB180
Content-Type: application/pdf;
name="spider bite case.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="spider bite case.pdf"
JVBERi0xLjQNCiXi48/TDQo2NyAwIG9iag0KPDwNCi9MaW5lYXJpemVkIDENCi9MIDEyNzYzMCAg
ICANCi9IIFsgNjkzIDgyOCAgICAgICAgICAgICAgXQ0KL08gNjkNCi9FIDU2OTk2ICAgICANCi9O
<snip>
aWxlcg0KPDwNCi9TaXplIDY3DQovSUQgWzwyOGJmNGU1ZTRlNzU4YTQxNjQwMDRlNTZmZmZhMDEw
OD48MjhiZjRlNWU0ZTc1OGE0MTY0MDA0ZTU2ZmZmYTAxMDg+XQ0KPj4NCnN0YXJ0eHJlZg0KMTQ2
DQolJUVPRg==
------=_NextPart_000_0036_01C91E59.83DAB180--
Years ago, there was an old uuencode/uudecode script that I recall using in
DOS, but I don't have anything similar in my Linux tool box yet. I'm sure it is
there, I just don't know what it is called or what it looks like. If somebody
could point me in the right direction, I would appreciate it. Thanks!
Umm... IIRC uunencode/uudecode had something to do with translating
binary to text between and stitching together of file transfers over
email before the days FTP became generally available on DOS and
bandwidth was a lot less than now. In the UK it was used to get material
from the Higher Education Software Archives (HENSA) up until the mid
1990s or so.

The above is something very different, it rather looks like mime
multi-part stuff and normally it is the responsibility of the mail
client to stitch the bits back together. So your are looking for a
different utility. What you need is something that can handle multi-part
mime.

- --
==============================================================================
I have always wished that my computer would be as easy to use as my
telephone.
My wish has come true. I no longer know how to use my telephone.

Bjarne Stroustrup
==============================================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkjjJX0ACgkQasN0sSnLmgIBMgCgvbYHKiII0ePLkYpGklwoiwHV
8fgAn1q4bOHKr1E7mvXASCdpQDzXc/fd
=x+zM
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Per Jessen
2008-10-02 08:54:01 UTC
Permalink
Post by David C. Rankin
Listmates,
I have had a number of occasions where colleagues have bungled
attachments to e-mail where I receive the message body and attachment
all run-together in the body of the message. Often times I need to be
able to un-encode and save the encoded spreadsheet, word processing
document or photo back to its .doc, .xls or .jpg native file format.
David,

all of those attachments are base64 encoded. You can use 'base64' to
decode them - 'base64' is part of coreutils.


/Per Jessen, Zürich
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
David C. Rankin
2008-10-02 14:16:14 UTC
Permalink
Post by Per Jessen
Post by David C. Rankin
Listmates,
I have had a number of occasions where colleagues have bungled
attachments to e-mail where I receive the message body and attachment
all run-together in the body of the message. Often times I need to be
able to un-encode and save the encoded spreadsheet, word processing
document or photo back to its .doc, .xls or .jpg native file format.
David,
all of those attachments are base64 encoded. You can use 'base64' to
decode them - 'base64' is part of coreutils.
/Per Jessen, Zürich
Per, Andrew,

Thanks, that's all I needed, off to man base64!
--
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Carlos E. R.
2008-10-11 12:36:25 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On Wednesday 2008-10-01 at 00:14 -0500, David C. Rankin wrote:


(I forgot to email this email)
Post by David C. Rankin
Listmates,
I have had a number of occasions where colleagues have bungled attachments to
e-mail where I receive the message body and attachment all run-together in the
body of the message. Often times I need to be able to un-encode and save the
encoded spreadsheet, word processing document or photo back to its .doc, .xls
------=_NextPart_000_0036_01C91E59.83DAB180
Content-Type: application/msword;
name="PETITION - Original.doc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="PETITION - Original.doc"
Yes, I know.
Post by David C. Rankin
Years ago, there was an old uuencode/uudecode script that I recall using in
DOS, but I don't have anything similar in my Linux tool box yet. I'm sure it is
there, I just don't know what it is called or what it looks like. If somebody
could point me in the right direction, I would appreciate it. Thanks!
There is uudedcode (package sharutils), but that will not help you because
the above is not uuencoded. That's mime, I think, with "base64" enconding.

The problem is, I guess, that the email got broken in transit. What I do
is to save(copy) the email to a separate mbox folder with just that
message, and edit it with an editor (joe or mcedit) till the mail program
understands the email correctly. Usually it is a runtogether line.

I got one of those recently, but it was spam, so I didn't try to
reconstruct.

[...]

I tried to find that email to test the procedure, but I couldn't find it
and then I forgot to email this.

HTH.

- --
Cheers,
Carlos E. R.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkjwncwACgkQtTMYHG2NR9XCSACgjM5BMpLqgRh1PlFdqr/iYpQH
zp4AniJci8/sjhSQRAkH6/JSiM30Xx+v
=aslr
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Loading...