Microsoft KB Archive/288756

= PRB: SMTP Transport Event OnArrival Does Not Fire For MAPI Messages =

PSS ID Number: 288756

Article Last Modified on 4/24/2003

-

The information in this article applies to:


 * Microsoft Windows 2000 Server SP1
 * Microsoft Windows 2000 Server SP2
 * Microsoft Windows 2000 Advanced Server SP1
 * Microsoft Windows 2000 Advanced Server SP2
 * Microsoft Windows 2000 Professional SP1
 * Microsoft Windows 2000 Professional SP2
 * Microsoft Exchange 2000 Server

-



This article was previously published under Q288756



SYMPTOMS
The Simple Mail Transfer Protocol (SMTP) Transport Event is used to modify mail as it passes through the SMTP service. Mail that is sent by using a MAPI client, such as Outlook, does not maintain these modifications.



CAUSE
When mail triggers the SMTP Transport Event, messages that are submitted by using MAPI are not in SMTP format. Therefore, changes that are made by the event's code are not persisted.



RESOLUTION
To resolve this problem, create and configure a second SMTP virtual server and route all messages from the first SMTP virtual server to the second virtual server. Then register your SMTP Transport Event on the second SMTP virtual server. This ensures that when the SMTP Transport Event fires, the message is in SMTP format.

In the following steps, you create a second SMTP virtual server, which listens on TCP port 26 and sends on TCP port 25. The default SMTP virtual server now listens on port 25 and sends externally on TCP port 26, which is being monitored by the second SMTP virtual server. In essence, any mail that comes through should come in to your default SMTP virtual server. If the mail is to be delivered internally, it is delivered by the default SMTP virtual server and is not passed on to the second SMTP virtual server. If the mail needs to be delivered externally, the default SMTP virtual server passes it to the second SMTP virtual server.  Open the Exchange System Manager and browse to the SMTP folder. This folder should be located at First Administrative Group/Servers/Server Name/Protocols/SMTP. Right-click the folder, click New, and then click SMTP Virtual Server. Type a name for the server, then click Next. For the IP address, select All Unassigned and then click Finish. A dialog box warns you that the server will not start because of conflicting IP addresses and ports. You can ignore this warning. Click Yes to continue. Right-click each SMTP virtual server and click Stop. Right-click the default SMTP virtual server and click Properties. On the Delivery tab, click Advanced. In the text box for Smart Host, type the fully-qualified domain name as it appears in the textbox directly above the Smart host textbox, and then click OK. On the Delivery tab, click Outbound connections. In the TCP port text box, type 26, and then click OK. Click OK to close this dialog box.</li> Right-click the other SMTP virtual server that you created and click Properties. On the General tab, click Advanced and select All Unassigned. Click Edit, change the TCP port to 26, and then click OK. Click OK again, and then click OK to close this dialog box.</li> Right-click each SMTP virtual server and click Start.</li>  Register the event on the second SMTP virtual server. To do this, use the following command: cscript smtpreg.vbs /add 2 OnArrival SampleOnArrivalEvent SampleSMTPEvent.TransportEventInterface &quot;mail from=*&quot; Note that the 2 after &quot;/add&quot; tells the script to register the event on the second SMTP virtual server. Normally this parameter is 1, for the first SMTP virtual server. </li></ol>

The previous procedure only works if you have just one Default SMTP Virtual Server and no SMTP connectors configured as Internet gateways. For example, the procedure does not work if you have one SMTP Virtual Server and one SMTP connector configured to forward outbound Internet mail to a smarthost. The following procedure is a different example:

<ol> Configure the SMTP connector to forward all mail to the new SMTP Virtual Server. <ol style="list-style-type: lower-alpha;"> Right-click the SMTP connector that is configured as the Internet gateway.</li> Click to select Properties.</li> On the General tab, select Forward mail through this connecton to the following smart hosts, and then type the FQDN of the Exchange server or type the server IP.</li> Verify that the Bridgehead server is the first SMTP Virtual Server in the list.</li></ol> </li> Configure the default SMTP Virtual Server to talk to port 26.</li> Configure the newly created SMTP Virtual Server to forward all the mail to the smarthost that was originally configured in the SMTP connector.</li></ol>

<div class="status_section">

STATUS
This behavior is by design.

Keywords: kbMsg kbprb KB288756

Technology: kbExchange2000Serv kbExchangeSearch kbwin2000AdvServ kbwin2000AdvServSearch kbWin2000AdvServSP1 kbWin2000AdvServSP2 kbwin2000Pro kbwin2000ProSearch kbWin2000ProSP1 kbWin2000ProSP2 kbwin2000Search kbwin2000Serv kbwin2000ServSearch kbwin2000ServSP1 kbwin2000ServSP2 kbWinAdvServSearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2003 Microsoft Corporation. All rights reserved.