Change location of mail.que file Exchange 2013 / 2016

Change location of mail.que file

The mail.que file is the queue database for SafetyNet. You can read more about SafetyNet on TechNet here.

To prevent the mail.que file eating up disc space on your system drive /  Exchange install drive,  you can change the location of this file to another drive. This can be done within the EdgeTransport.exe.config file. But first we need to make sure no mail submissions get lost ( since the Microsoft Exchange Transport service needs to be restarted  )

Create a Queue folder on another drive. Create a QueueDB and QueueLogs folder within the Queue folder. ( we just created a QueueDB folder and pointed the path of the logs to it as well )

Pause the Microsoft Exchange Transport service.

Monitor the mail queue ( logged in on the server where you want to change the mail.que file location ) :

Get-queue

Just in case you monitor it from another server :

Get-queue -Server “ServerNameWhereMailQueueWillBeChanged”

Wait until the queue decreases to zero everywhere.  ( be patient and refresh )

Stop the Microsoft Exchange Transport service.

Open a Notepad as admin and navigate to :

%ExchangeInstallPath%Bin\EdgeTransport.exe.config

Find the following keys within the <appSettings> section :

<add key=”QueueDatabasePath” value=”<LocalPathQueueDB>” />
<add key=”QueueDatabaseLoggingPath” value=”<LocalPathQueueLogs>” />

Change LocalPath with the path of the new location and save it: ( for example )

Q:\Queue\QueueDB
Q:\Queue\QueueLogs

Start the Microsoft Exchange Transport service.

You should see now a new mail.que file among the other files in the new directory.
The old mail.que file and / or it’s folder can be safely deleted now in it’s old location. This will free up disc space.

Having the mail.que file located on the system drive / Exchange Server install drive can be one reason for Back Pressure when the mail.que file starts to grow very large !

Verify Back Pressure Exchange 2013 / 2016

Leave a Reply

Your email address will not be published. Required fields are marked *