Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-06-17
5
Medium Priority
?
280 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Suggested Courses

926 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