?
Solved

MIME encapsulation in SMTP

Posted on 2009-03-28
2
Medium Priority
?
571 Views
Last Modified: 2013-11-30
I have a small HTML page and a small graphic object (PNG) that render perfectly in my browser.  I have converted the graphic object to base64 and have added email MIME headers to each section.

I then telnetted to port 25 of my mailserver and sent the info to the mailserver.

Outlook 2003 has no problem displaying the graphic object correctly.  If I try to forward the email to another account, it messes up the graphic image.

How do I fix this so the email can be properly forwarded without mangling the image?
Subject: A simple example
Mime-Version: 1.0
Content-Type: multipart/related; boundary="boundary-example";
	  type="text/html"
 
--boundary-example
Content-Type: text/html; charset="US-ASCII"
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test page</TITLE>
</HEAD>
<BODY>
<H1>This is a test page</H1>
<IMG SRC="CID:tst.png">
</BODY>
</HTML>
 
--boundary-example
Content-ID: <tst.png>
Content-Type: image/png
Content-Transfer-Encoding: base64
 
iVBORw0KGgoAAAANSUhEUgAAAfQAAACOCAIAAABIem3OAAAACXBIWXMAAAABAAAAAQBPJcTWAAAA
B3RJTUUH2AIYAQEVqNCnbwAADsdJREFUeJztnd2Sq6wShsmurypc4jqcS8vhXKJzNPvACSHQTVC
RP5+nVq0yDCIKvDQtwm1ZFgMAAHPxv9YZAACA8iDuAAATgrgDAEwI4g4AMCGIOwDAhCDuAAAT8l
+1K1lrjTHBzMs1cMX9yQX6kYPARGpM7gQAqCfuy7L4Uu6H+z+ttb7KOykPAsXUtEsAAFyNeuJ+E
gkzHxN+K9bel+WndS4AoADtfe7W2o/m9mqSizFXBQ+UXTPt1xD/fz/8gsfW3v1/xty8nx3lc9Dj
ewd54Pg6xwG3muat713R/iS6ZbSYa0is7OnLJbJxNTRTHRO+CHdrf6hp0IiWlvsO/3igy5qFDjm
g4AATU8nn7vkBXt5wX5edZIuBiRDnY3EnihY9bGJZfpB+gHw6bC+VxF3TWTE8DkyEBIb8/iz2So
eVBgD6p/0LVQCACbD23joLbyDuAAATgr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wjJTAcjNQTaKcH+RTXcoqHn9AJ6fIyysJVmbVFGysMVDESNxg0HPEGNxE/BK2B+znx
jxP6sBvEvRKiwn6MZiQz6jwSDbWT0feVSQ/pYvJjitfKPH2OinHwFkRze18K7ufxVo+4t0G0sDQ
OmhXiRcXAHobYoBGbmfnllRlTG9VNXzEq32BOH3C81bNw2AZyXqgmPH1aYJimMnwz0khTPEu7Vq
Z7PZ1VKkxxPr5Qjb23os8hiJwOTNeWoJT7rxjpdmc+jZXFG0xfLn4bselFRXCQyPxudw3iDgCwj
SI+8bOvi7gDAEwIX6gCAEwI4g4AMCGIOwDAhCDuAAAT8n9cjWt8JJPCJgAAAABJRU5ErkJggv8=
 
--boundary-example--

Open in new window

0
Comment
Question by:Tim Titus
2 Comments
 
LVL 7

Accepted Solution

by:
tymes earned 2000 total points
ID: 24013992
For this I would actually do a real email and really send it to myself...   After than I would mangle and test the results.  Or better just have system to forward the one to many after it was approved (buy looking at it or replying to it or clicking on something).

What I noticed is that your MIME 64 starts off with a line that is 77 characters then the rest are 76 characters, proper multiples of 4.   I don't even know if you won't get bitched at because it is not 72 instead or 76 characters... if spam filters detected you are forging stuff.. then they will likely block you...

Just send a real message... to a multiplexer and have it send out to everyone else... send it once to person A (to test or to authorize), then send it again once authorized to the list.


Ultimately, just send the message to yourself and then just forward the raw junk that you get.
0
 

Author Comment

by:Tim Titus
ID: 24014930
Ok, if I create an email in Outlook and then forward it to myself, how do I view the complete MIME inside the email?

If I "view source", it only displays the HTML of the email, not the entire MIME encapsulation.
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

What is Usenet? There are many different opinions on exactly what Usenet is an isn't. Many opinions are incorrect simply out of ignorance. The Wikipedia listing about Usenet does a good job of explaining it, so instead of repeating it all here I wi…
Check out the latest tech news, community articles, and expert highlights in August's newsletter.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Suggested Courses

621 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