Solved

500pts - Need help decoding an encoded e-mail Subject Line... Mime??

Posted on 2006-06-17
5
271 Views
Last Modified: 2010-04-15
Greetings all,

I have a routine that I have been using to 'Parse' email as it arrives. It mainly looks at the 'Subject' line to determine if it is something that I need to read and parse further.

Quite frankly I'm parsing email from Amazon. I look for 'Sold - ship now' to determine if an item has sold and I print a mailing lable for it as soon as I parse the email for name and address.

The problem is that Amazon has now encoded the subject line so that when I read the 'raw' data I no longer 'see' the "Sold - ship now" string that I was originally parsing.

I have tried to decode the string with /usr/local/bin/base64 but that results in an error telling me that '?' are not proper for base64.

So I need to know if there is a 'C' function available that will decode this mime type. The following is the encoded string and what the decoded string should say: (with out the quotes)

"=?iso-8859-1?B?U29sZCwgc2hpcCBub3cuIDAwNi0xMDEgQW5vdGhlciBCZWdpbm5pbmcgW0F1ZGlvIENEXSBSb2NrRm91ciA=?="

"Sold, ship now. 006-101 Another Beginning [Audio CD] RockFour"

Any help would be appreciated,

rrbecker

BTW - This running on a FreeBSD box....
0
Comment
Question by:rrbecker
  • 3
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
cwwkie earned 500 total points
ID: 16927538
the base64 encoded string of the subject is

U29sZCwgc2hpcCBub3cuIDAwNi0xMDEgQW5vdGhlciBCZWdpbm5pbmcgW0F1ZGlvIENEXSBSb2NrRm91ciA=

So you have to skip the first question marks, and also remove the ?= on the end.
0
 
LVL 2

Author Comment

by:rrbecker
ID: 16927582
Hi cwwkie,

Wow... Thanks for the tip and insight. I'll try it here in a bit and get back to you.

Again thanks....

rrbecker
0
 
LVL 2

Author Comment

by:rrbecker
ID: 16927641
Hi again cwwkie,

That works great.... Again thanks for the insite.

rrbecker
0
 
LVL 14

Expert Comment

by:cwwkie
ID: 16927652
If you run into more encoding problems, I can recommend the leetkey extention (http://leetkey.mozdev.org/) for firefox.
With that you can play in your browser encoding and decoding data. Very handy!
0
 
LVL 2

Author Comment

by:rrbecker
ID: 16927798
Hi cwwkie,

" ...I can recommend the leetkey extention...."

Thanks, for the link. I don't generally use Firefox but I'll fire it up and thake a look.

Again thanks,

rrbecker
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now