decoding technique in incoming email

Ben Conner
Ben Conner used Ask the Experts™
on
Hi,

I'm writing some custom code to analyze spam for incoming mail to our mail server.  I need to know what the following encoding method is from the text snippet below.  Have tried several things (UTF-8, MIME, etc) and haven't had any success so far:

Subject: =?UTF-8?B?8J+OgSBCbGFjayBGcmlkYXkgaXMgT04u?=

Thanks!

--Ben
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Principal Software Engineer
Commented:
According to

https://ncona.com/2011/06/using-utf-8-characters-on-an-e-mail-subject/

this is UTF-8 encoded base-64.  There's a PHP example as well.

"The encoding must be either B or Q, these mean base 64 and quoted-printable respectively. You can read the RFC 1342 document for more information about how they work."

If it doesn't decode to printable ... well, I wouldn't be surprised.  After all, it is spam, and it's trying every conceivable way to get somebody's attention.
Ben ConnerCTO, SAS developer

Author

Commented:
LOL,...in this case, I don't think it was spam.  Had captured the email temporarily to a client and it was from a major store.  But mail clients have to be able to figure out how to decode them, so it must be doable.

Thanks so much!  Way too much to keep track of...

--Ben

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial