Solved

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

Posted on 2006-06-17
5
274 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why adding test code changes the build ? 11 135
mixing C++ and C code elegantly 10 159
Read file descriptor 3 in C 14 121
Trouble linking program with -lcrypt 3 160
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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

763 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