The .stm or streaming media file is used in conjunction with the .edb file to comprise the Exchange database. Both files together make up the database, and as such, they should always be treated as a single entity. Typically, if you perform an action on the .edb file, such as with Exchange Server Database Utilities (Eseutil), the .stm file is automatically included.
The purpose of the .stm file is to store streamed native Internet content. To understand what that means, you should first understand the way in which legacy Exchange products handled data with only a single file.
In Exchange Server 5.5, for example, the Internet Mail Connector accepts inbound Multipurpose Internet Mail Extensions (MIME) messages and writes them to a disk queue where Exchange then converts them to the native MAPI content or MDBEF for use by the Information Store and MAPI clients. Then if an Internet API, such as Post Office Protocol version 3 (POP3) or IMAP4 requests the data, it is converted back again before being sent out. This back-and-forth conversion process can cause overhead and performance issues.
The streaming media file helps to alleviate some of this conversion.
Unlike the .edb file mentioned previously, the .stm file does not store data in a b-tree structure. When a message arrives through the Internet or Simple Mail Transfer Protocol (SMTP), it always arrives as a stream of bytes. In Exchange Server 2003 and Exchange 2000 Server, these messages are streamed directly to the .stm file where they are held until accessed by a MAPI client. So the content is not converted. That way, if the end user is consistently accessing mail through POP3, the mail items are pulled directly from the .stm file and are already in the proper state for delivery. In the case that the message is accessed by a MAPI client, however, the message is moved over to the .edb file and converted to Exchange native form, and is never moved back to the .stm file.
If the .stm file is missing or corrupt, it can be reconstructed. This may be a catastrophic loss, depending on the situation. If end users work in a non-MAPI environment, they may lose a great deal of data. To accomplish the reconstruction, you may use the /createstm switch of the Eseutil tool. Because the actual content is stored in the .stm file, but the pointers and header information for the messages are stored in the .edb file, the tool rebuilds the .stm file using that information, but without the content.