Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / October 2005

Tip: Looking for answers? Try searching our database.

Corrupt emails when using multipart content types

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim Mavers - 18 Aug 2005 19:28 GMT
I am running Exchange 2003 with latest SPs and am running into a very
strange problem.  When we receive certain emails, the contents of the
messages have been corrupted.  Exclamation points (!) seem to appear
randomly in the text (usually an exclamation point followed by a space).

The messages both contain HTML and TEXT content, the header is:

Content-Type: multipart/alternative;
boundary="----=_NextPart_000_365D_01C59758.21CA9D10"

The text version content type is:

------=_NextPart_000_365D_01C59758.21CA9D10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

The HTML version of the content type is:

------=_NextPart_000_365D_01C59758.21CA9D10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

The corruption only occurs in the HTML part and can occur anywhere (e.g. in
the middle of an HTML element name).  The emails are being sent from a .NET
application on a remote host (from the Microsoft SMTP service directly to
our Exchange server).

This only seems to be happening with our Exchange server.  I can send the
exact same message to a colleague's Exchange server (different company) and
it works fine.

Is there some strange encoding translation going on?   There's nothing
special about the way we send the email as the application was built using
the standard .NET mail classes (SmtpMail and MailMessage)
Rich Matheisen [MVP] - 18 Aug 2005 21:26 GMT
>I am running Exchange 2003 with latest SPs and am running into a very
>strange problem.  When we receive certain emails, the contents of the
[quoted text clipped - 21 lines]
>
>The corruption only occurs in the HTML part

Are you sure it doesn't appear in the original message? The text/html
is being sent in 7-bit format and shouldn't need any translation at
all.

You should be able to grab a copy of the message from the relay server
being used by the application.

>and can occur anywhere (e.g. in
>the middle of an HTML element name).  The emails are being sent from a .NET
[quoted text clipped - 4 lines]
>exact same message to a colleague's Exchange server (different company) and
>it works fine.

Are there any other relays or proxies between you and that application
that aren't between the application and the other mail systems?

>Is there some strange encoding translation going on?  

Not with a MIME content-type of "text/plain". The "quoted/printable"
transfer type, maybe. :)

>There's nothing
>special about the way we send the email as the application was built using
>the standard .NET mail classes (SmtpMail and MailMessage)

Do you get the same results if you use some other e-mail client to
read the message? You should be able to see the raw message by just
using telnet on port 110 and RETR the message. If the funky stuff
isn't in the raw message then maybe it's the client and not the serer
that's got the problem.

Signature

Rich Matheisen
MCSE+I, Exchange MVP
MS Exchange FAQ at http://www.swinc.com/resource/exch_faq.htm
Don't send mail to this address mailto:h.pott@getronics.com

Tim Mavers - 18 Aug 2005 22:28 GMT
> Are you sure it doesn't appear in the original message? The text/html
> is being sent in 7-bit format and shouldn't need any translation at
> all.

Yes, I am positive.  I have cc'd the email to multiple recipients (one on a
different exchange server in a different company and one to a gmail account)
and both look fine.  I also inspected the outgoing SMTP message itself and
there aren't any weird symbols.

The weird characters always start with an exclamation point (!)   I wonder
if something is thinking it is DBCS or something dealing with
quoted-printable.

I don't know why the .NET SmtpMail class uses encoding: 7bit for HTML
payloads.

> Are there any other relays or proxies between you and that application
> that aren't between the application and the other mail systems?

The only thing is anti-spam filtering of some sort (Intellireach for
Exchange).  I don't have control over that and am still in the process of
tracking down the details.
Tim Mavers - 18 Aug 2005 22:34 GMT
Actually I believe it is always exclamation point followed by a space.
>> Are you sure it doesn't appear in the original message? The text/html
>> is being sent in 7-bit format and shouldn't need any translation at
[quoted text clipped - 18 lines]
> Exchange).  I don't have control over that and am still in the process of
> tracking down the details.
Rich Matheisen [MVP] - 19 Aug 2005 01:53 GMT
>> Are you sure it doesn't appear in the original message? The text/html
>> is being sent in 7-bit format and shouldn't need any translation at
[quoted text clipped - 4 lines]
>and both look fine.  I also inspected the outgoing SMTP message itself and
>there aren't any weird symbols.

Then I guess it's time to inspect the contents of the message are it
arrives at the Eschange server. :) Time for a network monitor.

>The weird characters always start with an exclamation point (!)   I wonder
>if something is thinking it is DBCS or something dealing with
>quoted-printable.

The HTML portion of the message was in text/plain. The text portion
was in quoted/printable.

>I don't know why the .NET SmtpMail class uses encoding: 7bit for HTML
>payloads.

Probably because that's all that's needed. Unless there's 8-bit
characters in the MIME body part there's no need to use anything else.

>> Are there any other relays or proxies between you and that application
>> that aren't between the application and the other mail systems?
>
>The only thing is anti-spam filtering of some sort (Intellireach for
>Exchange).  I don't have control over that and am still in the process of
>tracking down the details.

That's where the network monitor will come in handy. You already know
the message arrives there in a usable format. What you need to do is
verify that it leaves there the same way it went in!

Signature

Rich Matheisen
MCSE+I, Exchange MVP
MS Exchange FAQ at http://www.swinc.com/resource/exch_faq.htm
Don't send mail to this address mailto:h.pott@getronics.com

Adam Hoffman - 22 Aug 2005 21:07 GMT
I can report that we're experiencing exactly the same behavior in the
HTML body portion of multi-part mails ("! " where perfectly normal
characters used to be), received through Exchange 2003 for a select
group of e-mail generated by the .Net components as well.  Additionally,
Intellireach is in the picture as well, which is what brought me to your
post.

We've gone ahead and sniffed the outbound messages directly in the
outbox, and the characters are intact at that point.  The translation
happens randomly during the client pickup.

If you have anymore information regarding a fix, please post.  If we
figure out anything here, we'll do the same.

Thanks,
-adam
adrenalinepcs - 31 Aug 2005 19:28 GMT
> *I can report that we're experiencing exactly the same behavior i
> the
[quoted text clipped - 18 lines]
>
> *** Sent via Developersdex http://www.codecomments.com *** *

we are having the exact same problem with eudora. on the same compute
with the same mail server we can send with outlook or outlokk expres
and it works fine

-
adrenalinepc

Cale - 16 Oct 2005 05:42 GMT
I had the same problem.  I changed the code to explicitly set the
BodyEncoding to Encoding.UTF7.  After this the problem went away.  

Cale

> > *I can report that we're experiencing exactly the same behavior in
> > the
[quoted text clipped - 30 lines]
> View this thread: http://www.mcse.ms/message1803393.html
>  

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.