Scenario
TransportServer1 computer gets a problem. The transport service wouldn't start. All messages accumulated in TransportRoles\Data\Queue\mail.que has not been delivered. It either cannot be fixed or will take more than two days to solve it.
Luckily, the TransportServer2 is running. New messages can be delivered even though it is overloaded.
TransportServer2 can deliver the messages in the mail.que of TransportServer1. How?
At TransportServer1:
Net Stop MSExchangeTransport
Copy all files in the folder (TransportRoles\Data\Queue\) of TransportServer1 and save them to a folder of TransportServer2, e.g. TempQueue.
At TransportServer2:
TempQueue:
This folder will have the following files from TransportServer1.
Still at Transport server2.
Repair the mail.que database;
Exchange Management Shell,
CD C:\TempQueue
Eseutil /r Trn /d. /8
offline defragmentation of the queue database by using Eseutil;
Eseutil /d mail.que
The Transport server will not accept the new mail but send out all messages in its own mail.que.
Net Pause MSExchangeTransport
From queue viewer utility, you could see that all messages are delivered or not.
After all messages are delivered,
If the mail.que is over two days, you must do the following. If you don't, messages are not delivered and NDR will be sent back. By default, expiration time is 2 days.
Set-TransportServer -MessageExpirationTimeout longertime
Net Stop MSExchangeTransport
Copy c:\TempQueue\*.* to c:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue
Net Start MSExchangeTransport
All messages will be delivered.
Net Stop MSExchangeTransport
Delete all files in the directory c:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue
Net Start MSExchangeTransport
A fresh mail.que will be automatically created.
============
Observation
We can use the ESEUTIL utility to fix some problems of mail.que.
Scenario:
An Exchange transport server has a fragmented queue database that grows so large that it consumes all available hard disk drive space.
The transport server is working but the performance is bad because of the fragmented queue.
Net Stop MSExchangeTransport
Exchange Management Shell,
CD C:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue
Eseutil /r Trn /d. /8
offline defragmentation of the queue database by using Eseutil;
Eseutil /d mail.que
Net Start MSExchangeTransport
========
How do you change the path for the mail.que?
EdgeTransport.exe.config file
look for key="QueueDatabasePath"