Platform SDK: Exchange Server

MIME and Uuencode Encodings

The Exchange Internet Mail Client and Internet Mail Service generate TNEF encodings when sending a MAPI message to another SMTP host. The TNEF binary stream is stored in a file attached to the message called WINMAIL.DAT. If the receiving system is TNEF-aware, it can detect the WINMAIL.DAT attachment and retrieve the MAPI properties from the TNEF stream contained in the attachment.

The Internet Mail Service supports both uuencode and MIME encoding for TNEF attachments in SMTP messages. MIME is the preferred encoding, although which encoding is used depends on the capabilities of the receiving system. The Microsoft Mail for PC Networks SMTP Gateway only supports uuencode.

MIME

If sending a TNEF message to a system which supports MIME, the “multipart/mixed” content type should be used for the message. The TNEF stream must be base64 encoded and placed in a MIME body part of Content-Type application/ms-tnef. All file attachments sent with the message must be encapsulated in the TNEF stream. No other content types or encodings are supported for transmitting the TNEF stream. MIME encoding is described in detail in the documents RFC-1521 and RFC-1522, which are available from a number of sources on the Internet.

Uuencode

If sending to a system which does not support MIME, the WINMAIL.DAT attachment should be uuencoded and placed directly in the body of the message. All file attachments sent with the message should be uuencoded and placed into the message body separately. A gateway or client that receives a non-MIME message should look for a uuencoded file called WINMAIL.DAT in the body of the message. The order of attachments in the message does not matter. Uuencode encoding is described in the online manual pages for most UNIX systems; there is no RFC document describing this encoding method.

TNEF Correlator

It is not always safe to assume that a TNEF stream found in a message belongs with that message and should be decoded. Many foreign messaging systems return the contents of a message along with nondelivery reports. Also, if a recipient is on a system that does not support TNEF replies to a message, the original TNEF stream will no longer be valid. To avoid this problem, some piece of information found in both the TNEF stream and the message header must be used to correlate them.

The Internet Mail Service adds a MAPI property, PR_TNEF_CORRELATION_KEY, to each outgoing message before converting it to TNEF format. The value stored in PR_TNEF_CORRELATION_KEY is also placed in a header in the SMTP message, called X-MS-TNEF-Correlator.

When the Internet Mail Service receives a message with a TNEF attachment, it looks for PR_TNEF_CORRELATION_KEY in the TNEF attachment. If it exists and matches the value of X-MS-TNEF-Correlator, then the TNEF is decoded. If they do not match or if X-MS-TNEF-Correlator is missing, then the TNEF stream is ignored.

If the PR_TNEF_CORRELATION_KEY property is not present, then the TNEF is decoded. This is necessary to retain compatibility with the Microsoft Mail SMTP Gateway and the Exchange Internet Mail Client, which do not use PR_TNEF_CORRELATION_KEY.

Support for the X-MS-TNEF-Correlator header field is not mandatory, but SMTP gateways that generate TNEF format can use PR_TNEF_CORRELATION_KEY and X-MS-TNEF-Correlator to detect cases where message contents are returned in reports. Your software should never require PR_TNEF_CORRELATION_KEY on messages it receives.

MIME and Uuencode Examples

This section contains examples of messages containing MIME encoded and uuencode encoded TNEF streams.

MIME

The example below shows the headers and body of a MIME message containing a TNEF stream. Note that the value of the X-MS-TNEF-Correlator field is the same as the Message-ID field, and that the Internet Mail Service has placed the message body and the TNEF stream in different MIME parts of the message.

Received: by doug10.wspu.microsoft.com with Microsoft Exchange (IMS 4.5.1336)
    id <01BAE995.CB639550@doug10.wspu.microsoft.com>; Tue, 23 Jan 1996 13:22:07 -0800
Message-ID: <c=US%a=_%p=MICROSOFT%l=DOUG10960123132206AF005100@doug10.wspu.microsoft.com>
X-MS-TNEF-Correlator: <c=US%a=_%p=MICROSOFT%l=DOUG10960123132206AF005100@doug10.wspu.microsoft.com>
From: "Doug" <doug2@10.wspu.MICROSOFT.com>
To: "Douglas" <doug@osu-beavers.wspu.microsoft.com>
Subject: What is the status of my order?
Date: Tue, 23 Sep 1996 13:22:06 -0800
X-Mailer:  Microsoft Exchange Server Internet Mail Connector Version 4.5.1336
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="---- =_NextPart_000_01BAE995.CB66A290"

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.  Contact your
mail administrator for information about upgrading your reader to a version
that supports MIME.

------ =_NextPart_000_01BAE995.CB66A290
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hey Doug,

Just checking on the status of the Coffee I ordered from you on Monday.

Doug

------ =_NextPart_000_01BAE995.CB66A290
Content-Type: application/ms-tnef
Content-Transfer-Encoding: base64

eJ8+IggVAQaQCAA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NPRlQvT1U9MTAvQ049UkVDSVBJRU5UUy9DTj1ET1VHU1QgKERPVUdTVDEwKQAAAB4A+D8B
AAAAEQAAAGRvdWdzdChkb3Vnc3QxMCkAAAAAAgH7PwEAAABSAAAAAAAAANynQMjAQhAatLkIACsv
4YIBAAAAAAAAAC9PPU1JQ1JPU09GVC9PVT0xMC9DTj1SRUNJUElFTlRTL0NOPURPVUdTVCAoRE9V
R1NUMTApAAAAHgD6PwEAAAARAAAAZG91Z3N0KGRvdWdzdDEwKQAAAABAAAcwkHky0NjpugFAAAgw
gFc02djpugEDAA00/T8AAAIBFDQBAAAAEAAAAFSUocApfxAbpYcIACsqJRceAD0AAQAAAAEAAAAA
AAAACwApAAAAAAALACMAAAAAAAIBfwABAAAAUgAAADxjPVVTJWE9XyVwPU1JQ1JPU09GVCVsPURP
VUdTVDEwOTYwMTIzMTMyMjA2QUYwMDUxMDBAZG91Z3N0MTAud3NwdS5taWNyb3NvZnQuY29tPgAA
ANrg

------ =_NextPart_000_01BAE995.CB66A290--
 

Uuencode

The example below shows the headers and body of a RFC-822 message containing a uuencoded TNEF stream. Note that the value of the X-MS-TNEF-Correlator field is the same as the Message-ID field, and that the encoded TNEF stream is part of the message body.

Received: by doug10.wspu.microsoft.com with Microsoft Exchange (IMS 4.5.1336)
    id <01BAE996.1A250570@doug10.wspu.microsoft.com>; Tue, 23 Jan 1996 13:24:19 -0800
Message-ID: <c=US%a=_%p=MICROSOFT%l=DOUG10960123132418AG005100@doug10.wspu.microsoft.com>
X-MS-TNEF-Correlator: <c=US%a=_%p=MICROSOFT%l=DOUG10960123132418AG005100@doug10.wspu.microsoft.com>
From: "Doug" <doug2@10.wspu.MICROSOFT.com>
To: "Douglas" <doug@wspu.microsoft.com>
Subject: What is the status of my order?
Date: Tue, 23 Sep 1996 13:24:18 -0800
X-Mailer:  Microsoft Exchange Server Internet Mail Sonnector Version 4.5.1336
Encoding: 8 TEXT, 32 UUENCODE
X-MS-Attachment: WINMAIL.DAT 0 00-00-1980 00:00

Hey Doug,

Just checking on the status of the Coffee I ordered from you on Monday.

Doug


begin 600 WINMAIL.DAT
M>)\^(A05`0:0" `$```````!``$``0>0!@`(````Y 0```````#H``$(@ <`
M& ```$E032Y-:6-R;W-O9G0@36%I;"Y.;W1E`#$(`06 `P`.````S <!`!<`
M#0`8`!(``@`D`0$@@ ,`#@```,P'`0`7``T`& `3``(`)0$!"8 !`"$````R
M,C(Q,D4W-T5&-31#1C$Q.$8V13 P04$P,#4Q14,X,0`=!P$-@ 0``@````(`
M`@`!!( !`" ```!7:&%T(&ES('1H92!S=&%T=7,@;V8@;7D@;W)D97(_`"L+
M`0.0!@`,! ``&@````,`)@```````P`V```````#``80J'8Q+0,`!Q!8````
M'@`($ $```!9````4T5.1$E.1U=)5$A5545.0T]$14A%641/54<L2E535$-(
M14-+24Y'3TY42$535$%455-/1E1(14-/1D9%14E/4D1%4D5$1E)/35E/54].
M34].1$%91$]51P`````#`! 0``````,`$1 ``````@$)$ $```#_````^P``
M`+X!``!,6D9UK)IM4O\`"@$/`A4"I /D!>L"@P!0$P-4`@!C: K <V5T[C(&
M``;#`H,R`\8'$P*#(C,/>FAE; ,@1&P:9P*#- /%`@!P<G&A$B)S=&5M`H,U
M$PW^?0J ",\)V0* "H$-L0M@X&YG,3 S%" +"A+RDP'0!E%N9 N 9R #\ !T
M:"!5545.0_!/1$4N'> *A0J/"Y%C%V(<84AE>14P"&!GTBP>'$IU%M @$; %
MD)9K'-("(" =,&4@%M#L870AL")P9B*C"% -T'D)X"!)(G +( 20"8 @60-2
M('D(8")R30(@9'QA>1X-('(;K1Z%&&$``2C0``,``ED"````'@!P``$````@
M````5VAA="!I<R!T:&4@<W1A='5S(&]F(&UY(&]R9&5R/P`"`7$``0```!8`
M```!NNG9)S\[]MX%51@1SX]N`*H`4>R!``! `#D`</Y")]GIN@$#`/$_"00`
M``(!1P`!````, ```&,]55,[83T@.W ]34E#4D]33T94.VP]1$]51U-4,3 M
M.38P,3(S,C$R-#$X6BTW``(!^3\!````4@````````#<IT#(P$(0&K2Y" `K
M+^&"`0`````````O3SU-24-23U-/1E0O3U4],3 O0TX]4D5#25!)14Y44R]#
M3CU$3U5'4U0@*$1/54=35#$P*0```!X`^#\!````$0```&1O=6=S="AD;W5G
M<W0Q,"D``````@'[/P$```!2`````````-RG0,C 0A :M+D(`"LOX8(!````
M`````"]//4U)0U)/4T]&5"]/53TQ,"]#3CU214-)4$E%3E13+T-./41/54=3
M5" H1$]51U-4,3 I````'@#Z/P$````1````9&]U9W-T*&1O=6=S=#$P*0``
M``! ``<P$"K'%]GIN@% ``@P,%K#)]GIN@$#``TT_3\```(!%#0!````$ ``
M`%24H< I?Q ;I8<(`"LJ)1<>`#T``0````$`````````"P`I```````+`",`
M``````(!?P`!````4@```#QC/553)6$]7R5P/4U)0U)/4T]&5"5L/41/54=3
M5#$P.38P,3(S,3,R-#$X04<P,#4Q,#! 9&]U9W-T,3 N=W-P=2YM:6-R;W-O
,9G0N8V]M/@```,WY
`
end