📄 ch4.htm
字号:
<p>The MAPI model defines a handful of properties for storage folders. These properties
are available through the OLE Messaging library and C++. Table 4.4 lists some of the more
commonly used properties of the storage folder.<br>
</p>
<p align="center"><b>Table 4.4. Example MAPI storage folder properties.</b> </p>
<div align="center"><center>
<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
<tr>
<td><i>Property Name</i></td>
<td WIDTH="210"><i>Type</i> </td>
<td WIDTH="262"><i>Description</i></td>
</tr>
<tr>
<td WIDTH="119"><tt><font FACE="Courier">FolderID</font></tt> </td>
<td WIDTH="210">String</td>
<td WIDTH="262">This is a string value that uniquely identifies this folder. </td>
</tr>
<tr>
<td WIDTH="119"><tt><font FACE="Courier">Folders</font></tt> </td>
<td WIDTH="210"><tt><font FACE="Courier">Folders</font></tt> collection object </td>
<td WIDTH="262">This is the set of folder objects contained by the current folder. Any
folder can contain one or more sublevel folders. </td>
</tr>
<tr>
<td WIDTH="119"><tt><font FACE="Courier">Messages</font></tt> </td>
<td WIDTH="210"><tt><font FACE="Courier">Messages</font></tt> collection object </td>
<td WIDTH="262">This is the set of messages stored in this folder. </td>
</tr>
<tr>
<td WIDTH="119"><tt><font FACE="Courier">Name</font></tt></td>
<td WIDTH="210">String</td>
<td WIDTH="262">A unique user-defined string that identifies the storage folder. </td>
</tr>
<tr>
<td WIDTH="119"><tt><font FACE="Courier">Parent</font></tt> </td>
<td WIDTH="210">Object</td>
<td WIDTH="262">This contains the name of the parent folder or <tt><font FACE="Courier">InfoStore</font></tt>
to which the current folder belongs. </td>
</tr>
</table>
</center></div><div align="center"><center>
<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
<tr>
<td><b>Note</b></td>
</tr>
<tr>
<td><blockquote>
<p>You can find additional information on <tt><font FACE="Courier">Folder</font></tt> and <tt><font
FACE="Courier">InfoStore</font></tt> objects, their properties, and their methods in <a
HREF="ch8.htm">Chapter 8</a>, "The OLE Messaging Library," and <a HREF="ch9.htm">Chapter
9</a>, "Creating a MAPI Mailing List Manager with the OLE Messaging Library." </p>
</blockquote>
</td>
</tr>
</table>
</center></div>
<p>Physical organization of the storage folders can differ greatly depending on the
service provider. For example, the Microsoft Mail Server storage arrangement involves a
single directory on the disk that identifies the post office and subsequent directories
underneath that correspond to an individual user's <tt><font FACE="Courier">InfoStores</font></tt>
(and subfolders within the storage). However, the physical organization of storage folders
for the Windows Messaging Client that ships with Windows 95 involves a single data file
(usually found in <tt><font FACE="Courier">\Exchange\mailbox.pst</font></tt>). This single
file is used to store all the personal messages maintained on the user's workstation. It
is up to the service provider to establish the storage details and to support access to
the physical storage using the pre-defined <tt><font FACE="Courier">InfoStore</font></tt>,
<tt><font FACE="Courier">Folder</font></tt>, and <tt><font FACE="Courier">Message</font></tt>
objects. </p>
<h3><a NAME="Addresses">Addresses</a></h3>
<p>Addresses are the last class of objects dealt with at the client level. Every
electronic message has at least two address objects: the sender object and the recipient
object. MAPI allows you to add several recipient address objects to the same message. Each
address object has several properties. Table 4.5 shows a set of sample properties for the
MAPI <tt><font FACE="Courier">Address</font></tt> object.<br>
</p>
<p align="center"><b>Table 4.5. MAPI <tt><font FACE="Courier">Address</font></tt> object
properties.</b> </p>
<div align="center"><center>
<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
<tr>
<td><i>Property Name</i></td>
<td WIDTH="83"><i>Type</i> </td>
<td WIDTH="362"><i>Description</i></td>
</tr>
<tr>
<td WIDTH="145"><tt><font FACE="Courier">Address</font></tt> </td>
<td WIDTH="83">String</td>
<td WIDTH="362">This is the unique electronic address for this address object. The
combination of the <tt><font FACE="Courier">Type</font></tt> property (see below) and the <tt><font
FACE="Courier">Address</font></tt> property creates the complete MAPI address. Sample
address properties are <br>
<tt><font FACE="Courier">MikeA@isp.net</font></tt>-Internet address<br>
<tt><font FACE="Courier">/MailNet1/PostOfc9/MCA</font></tt>-MS Mail address </td>
</tr>
<tr>
<td WIDTH="145"><tt><font FACE="Courier">DisplayType</font></tt> </td>
<td WIDTH="83">Long</td>
<td WIDTH="362">The MAPI service allows programmers to define addresses by type. This
means you can sort or filter messages using the <tt><font FACE="Courier">DisplayType</font></tt>
property. Sample address types are <br>
<tt><font FACE="Courier">mapiUser</font></tt>-Local user<br>
<tt><font FACE="Courier">mapiDistList</font></tt>-Distribution list<br>
<tt><font FACE="Courier">mapiForum</font></tt>-Public folder<br>
<tt><font FACE="Courier">mapiRemoteUser</font></tt>-Remote user </td>
</tr>
<tr>
<td WIDTH="145"><tt><font FACE="Courier">Name</font></tt></td>
<td WIDTH="83">String</td>
<td WIDTH="362">This is the name used in the Address book. Usually, this is an
easy-to-remember name such as "Fred Smith" or "Mary in Home Office." </td>
</tr>
<tr>
<td WIDTH="145"><tt><font FACE="Courier">Type</font></tt></td>
<td WIDTH="83">String</td>
<td WIDTH="362">This value contains the name of the message transport type. This allows
MAPI to support the use of external message transport services. Sample address types are <br>
<tt><font FACE="Courier">MS:</font></tt>-Microsoft Mail transport<br>
<tt><font FACE="Courier">SMTP:</font></tt>-Simple Mail Transport Protocol<br>
<tt><font FACE="Courier">MSN:</font></tt>-Microsoft Network transport </td>
</tr>
</table>
</center></div>
<p>MAPI address objects are a part of every MAPI message and are stored in the MAPI
address book. You'll learn more about the address book in the following section on MAPI
Server objects. </p>
<h2><a NAME="TheMAPIServer"><font SIZE="5" COLOR="#FF0000">The MAPI Server</font></a></h2>
<p>The MAPI Server handles all the message traffic generated by MAPI clients. The MAPI
Server usually runs on a standalone workstation connected to the network, but this is not
a requirement. There are versions of user-level MAPI servers that can be used to handle
message services. </p>
<p>Microsoft supports two standalone MAPI servers:
<ul>
<li><font COLOR="#000000">Microsoft Mail Server (for both pcs and Apple workstations)</font>
</li>
<li><font COLOR="#000000">Microsoft Exchange Server (for NT Server workstations)</font> </li>
</ul>
<p>The Microsoft Mail Server runs standalone on both Intel pcs or Apple workstations. It
provides direct MAPI services for all connected MAPI users and also provides gateway MAPI
services for remote users. The Microsoft Mail Server has, until recently, been Microsoft's
primary electronic mail server. Even though Microsoft is stressing the early adoption of
the new Microsoft Exchange Server for NT, the Microsoft Mail Server will continue to be
the primary mail server for thousands of users. All MAPI Clients can share information
with connected Microsoft Mail Servers regardless of the client platform (Win31, WinNT, or
Win95). </p>
<p>The Microsoft Exchange Server runs as a service on an NT Server workstation. It
provides MAPI services to all MAPI users. Unlike the Microsoft Mail Server, which
distinguishes between local and remote users, the Microsoft Exchange Server treats all
MAPI users as remote users. This simplifies several aspects of MAPI administration. Unlike
the Microsoft Mail Server, which only supports Microsoft Mail format messages, the
Microsoft Exchange Server supports multiple message formats and services, including
Microsoft Mail. This also means that the administration of gateways and remote transports
is quite different for Microsoft Exchange. </p>
<p>Microsoft also supports two peer-to-peer message servers. These servers run on the
user's workstation, usually as a part of the MAPI client software. The two client-level
MAPI servers provided by Microsoft are
<ul>
<li>WorkGroup Post Office for Windows for WorkGroups </li>
<li>Windows Messaging Client for Windows 95 </li>
</ul>
<p>The WorkGroup Post Office runs as a limited version of the Microsoft Mail Server.
Clients that use Microsoft's peer-to-peer networking are able to establish a post office
on a single workstation and then share the post office directories with other peers on the
network. The design and operation are very much like the Microsoft Mail Server system, but
it runs on an individual pc. The primary advantage of the peer-to-peer version is that a
single user can set up a WorkGroup Post Office and use that as a base for adding remote
mail connections and fax support. The main disadvantage of the peer-to-peer client is that
users were not able to attach to both the WorkGroup Post Office and an existing Microsoft
Mail Server post office. </p>
<p>With the introduction of Windows 95, Microsoft introduced a client version of Microsoft
Exchange that provides the same features as the Microsoft Exchange Server version. Users
are able to install and share a WorkGroup Post Office and are also able to attach to
existing Microsoft Mail post offices. In addition, users can connect using other mail
transports as they become available. </p>
<p>Regardless of the actual server application used, the same basic processes must occur
for all MAPI server systems. The three main tasks of all MAPI servers are
<ul>
<li><i>Message transport</i>-Moving the message from location to location. </li>
<li><i>Message storage</i>-Providing a filing system for the storage and retrieval of
received messages. </li>
<li><i>Address book services</i>-Providing centralized addressing and verification services
that can be used by all MAPI clients. </li>
</ul>
<p>The next three sections discuss each of these processes in greater detail. </p>
<h3><a NAME="MessageTransport">Message Transport</a></h3>
<p>Message Transport is the process of moving messages from one place to another. Under
the MAPI model, message transport is a distinct, and often separate, process. MAPI 1.0
allows for the use of <i>external message transports</i>. In other words, programmers can
write software that knows how to handle a particular type or types of message formats and
register this transport mechanism as part of the MAPI system. This allows third-party
vendors to create format-specific transports that can be seamlessly integrated into the
MAPI system. </p>
<p>It is the message transport that knows just how to format and, if necessary,
pre-process messages for a particular messaging format. The message transport knows
exactly what information must be supplied as part of the message header and how it needs
to be arranged. The message transport also knows what types of message bodies are
supported. For example, SMTP format allows only text message bodies. However, the
Microsoft Network message format allows rich-text message bodies. It is the job of the
message transport to keep track of these differences, modify the message where
appropriate, or reject the message if modification or pre-processing is not possible. </p>
<p>One of the key features of the MAPI model is the provision for multiple message
transports within the MAPI system. Once message transports are installed (or registered)
with a MAPI client application, they are called into action whenever the pre-defined
message type is received by the MAPI client software. Since MAPI is designed to accept the
registration of multiple transports, the MAPI Client is potentially capable of handling an
unlimited number of vendor-specific message formats. </p>
<div align="center"><center>
<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -