Solved

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

Posted on 2006-06-17
5
273 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
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 opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

776 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