Solved

Decode an email subject..

Posted on 2001-07-03
2
3,541 Views
Last Modified: 2012-08-13
Hi, I want to decode this email subject:

Subject: =?iso-8859-1?B?VGVzdGluZyBlbWFpbCBoZWFkZXJz?=

It was generated using MailStudio @Message from 3rsoft.com, but I don't know what kind of codification is using..

I tried using the MIME::Base64 decode function but it didn't work.

The "translation" of the subject is: Testing email headers

Could you help me?
There are also another lines of the email header that are encoded, like the From line. I guess that it can be decoded using the same script that will decode the Subject line.

Thanks.
0
Comment
Question by:jcao
2 Comments
 
LVL 5

Accepted Solution

by:
Sapa earned 200 total points
ID: 6250963
------------------ sample ---------------------
use MIME::Base64;

if ($subject=~/^=\?[\w-]+\?B\?(.*)\?=$/) {
    $subject=decode_base64($1);
}
-----------------------------------------------

- Sapa
0
 

Author Comment

by:jcao
ID: 6252924
Thank you very much
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

726 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