Groups | Blog | Home
all groups > dotnet sdk > august 2005 >

dotnet sdk : Corrupt emails when using multipart content types


Tim Mavers
8/18/2005 1:28:48 PM
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]
8/18/2005 4:26:06 PM
[quoted text, click to view]

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.

[quoted text, click to view]

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

[quoted text, click to view]

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

[quoted text, click to view]

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.

--
Rich Matheisen
MCSE+I, Exchange MVP
MS Exchange FAQ at http://www.swinc.com/resource/exch_faq.htm
Tim Mavers
8/18/2005 4:28:10 PM
[quoted text, click to view]

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.

[quoted text, click to view]

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
8/18/2005 4:34:10 PM
Actually I believe it is always exclamation point followed by a space.
[quoted text, click to view]

Rich Matheisen [MVP]
8/18/2005 8:53:14 PM
[quoted text, click to view]

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.

[quoted text, click to view]

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

[quoted text, click to view]

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.

[quoted text, click to view]

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!

--
Rich Matheisen
MCSE+I, Exchange MVP
MS Exchange FAQ at http://www.swinc.com/resource/exch_faq.htm
Adam Hoffman
8/22/2005 1:07:38 PM
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
8/31/2005 1:28:52 PM

[quoted text, click to view]

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
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message1803393.htm
Cale
10/15/2005 9:42:27 PM
I had the same problem. I changed the code to explicitly set the
BodyEncoding to Encoding.UTF7. After this the problem went away.

Cale

[quoted text, click to view]
AddThis Social Bookmark Button