Exchange hub transport “Mail.que” file large in size
I had to deal with a “huge” mail.que file this morning and thought of letting you know how to handle similar issues.So, here is the scenario
- Came to know about this issue only when SCOM alerted for a low disc space
- On one of the hub transport servers, the mail.que file reached to 148GB (unbelievable)
A lil about the mail.que file:
The mail.que file temporarily stores all emails before it is delivered to the target. It is an ESE database which means it is similar in architecture like an Exchange mailbox database, the edb file.
As per a TechNet article
A queue is a temporary holding location for messages that are waiting to enter the next stage of processing. Each queue represents a logical set of messages that a transport server processes in a specific order. Queues exist only on servers that have the Hub Transport server role or Edge Transport server role installed.
Let’s take a look at the other files residing in this location:
Trn.chk – Checkpoint file like E0x.chk in exchange
Trn.log – The transaction log file which is getting committed now. Similar to E00.log in exchange
Trntmp.log – The next transaction log file which is created in advance.
Trnnnn.log – Next transaction log file created when Trn.log reaches its maximum size.
Trnres00001.jrs – First reserve log file. Only used when the hard disk drive that contains the transaction log runs out of space to stop the queue database cleanly
Trnres00002.jrs – Second Reserve log file.
Temp.edb – Temp database used to verify database schema on start-up.
Back to the issue:
You need to know 2 important terms before we proceed since this issue could have caused due to a combination of both:
- PipelineTracingEnabled: This is used for troubleshooting purposes and is not enabled by default.
- MaxDumpsterSizePerStorageGroup: This is for Exchange 2007. The maximum size of the transport dumpster queue per storage group. This is a universal setting for all storage groups; you can’t set variable sizes for each storage group. The recommended size is 1.5 times the maximum message size that can be sent. For example, if the maximum size for messages is 10 megabytes (MB), you should configure the MaxDumpsterSizePerStorageGroup parameter with a value of 15 MB. Read more here
You can use the cmdlet: Get-TransportServer | fl to get these details.
In my case, tracing was enabled and the dumpster was specified to be 50GB.
Enough talking and lets delete it now
This is the suggested way to get rid of the old mail.que file and get a new one without any downtime. I proceed under the assumption that you have multiple hub transport servers to process emails so, no emails will be processed at the time of this change. This
should take about less than a minute. I will call the Hub transport server HUB01. Remember that steps 6-8 are very important and will ensure none loses emails
- Login to HUB01
Take a look at the size of the mail.que file
- Open exchange management shell and run “Get-TransportServer ” HUB01″ |fl
Here, look for PipelineTracingEnabled. This should be set to False. If not, run
Set-TransportServer HUB01 -PipelineTracingEnabled $False
Now run “Get-TransportConfig” and ensure that
MaxDumpsterSizePerStorageGroup is in MB’s and not GB’s
MaxDumpsterTime : 7.00:00:00
If not, run
Set-TransportConfig -MaxDumpsterSizePerStorageGroup <size> -MaxDumpsterTime <timespan>
- Now run “Get-Queue” and take a look at the count of messages in HUB01
- Goto services.msc and Pause the Microsoft Exchange Transport service
- Again, run “Get-Queue” and ensure all pending messages are “zeroed” out
- Once messages pending becomes zero, stop the Transport service
- Move the mail.que file and all others to a new folder in the same location
- Start the Transport service
- Take a look at the queue again
- You should see that messages would have started getting delivered
- Now you can backup or safely delete the old mail.que file
Keywords: Delete mail.que file, delete large mail.que file, mail.que file large in size, huge mail.que file in exchange, exchange 2007 mail.que file, mail.que file too big