Mail.que Corrupt or Large File Size Issue in Exchange 2013/10/16/07

Hello guys, in this article, I am going to have a discussion about Mail.que file corrupt or large size of queue database file issue. As you might know, Mail.que is a temporary file which is being created in sending queue of Exchange server. When each mail is being sent, then it goes into the sending queue of Exchange server and then it is being delivered to the recipient mailbox. With passing the time, it has been necessary to maintain mail.que database time to time for fixing the common issues, like performance issue in the case of a large or fragmented file for removing white spaces. Nowadays, if the mail.que temporary database file is not being maintained time to time then it may lead into the email burst situation especially in the case of large file attachments.

Mail.que Corrupt or Large File Size Issue in Exchange 2013/10/16/07

Prerequisites for Maintaining Mail.que File

There are some following prerequisites, which you should have for fixing the issues as well as maintaining the mail.que file.

  1. You should have Exchange Server Administrator account access.
  2. You should have full control for Network management, System as well as User account management.
  3. For restoration of mail.que file from another transport server to another then it is necessary that both transport servers should be hosted within an Active Directory forest.

Restoration of Mail.que Database File

In this section, we will see the complete process mail.que database restoration using commands as well EAC or EMC. For every different version of Exchange Server, we have to go with different restoration techniques.

Exchange 2007 / Exchange 2010 Large mail.que File

  1. Locate the databaseNavigate at below mentioned location for getting mail.que file in Exchange Server 2007/2010.
    In hub transport server:
    C:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue
    In Edge Transport server:
    C:\Program Files\Microsoft\Exchange Server\Bin
  2. Disconnect the mail.que file and create new one for not stopping the mail flowNow select Mail.que, Trn.chk, Temp.edb, Trn.log, Trnnnn.log, Trnres00001.jrs, Trnres00002.jrs, and Trntmp.log and put into any other temporary folder/location.Now restart the Exchange server, in this case again a new mail.que file would be created and the mail flow won’t stop.
  3. Fixing issues & Maintaining the databaseNow, run below mentioned command in PowerShell. For running this command you have to specify the complete location of Mail.que file.
    Command: eseutil /d [CompleteLocation]/mail.que
  4. Put mail.que into transport server by replacing the existing oneFirst of all pause the current mail flow in Exchange server by running below-mentioned command:
    Net Pause MSExchangeTransport
    Now make sure whether all mail flow has stopped or not by running below-mentioned command:
    Get-QueueNow resubmit the unreachable queues:

    Retry-Queue –Identity "Unreachable" -Resubmit $True

    Now reinject the mail.que into the transport server:

    For this just stop MSExchangeTransport Service, then copy & paste the mail.que file into the earlier location in Transport server database location and start MSExchangeTransport again.

    That’s all what you have to do in case of Exchange 2007.

Move Mail.que File in Exchange 2013 / 2016

In the case of Exchange server 2013/2016, we are about to change the location of mail.que file at another location.

  1. First, create the new folder where you want to keep the database and transaction log.
  2. Run below command to open Exchange transport configuration file.
    Notepad %ExchangeInstallPath%Bin\EdgeTransport.exe.config
  3. Modify the key value in appSetting tag as displayed below.
    mail.que file corrupt in Exchange Server
  4. Now, save and close the configuration file.
  5. Now, restart Exchange transport service by running the following command:
    net stop MSExchangeTransport && net start MSExchangeTransport
  6. Now, go to the new location to check for newly created files.
  7. Now, stop the Exchange Transport Service by running below mentioned command:
    net stop MSExchangeTransport
  8. Move all existing transactions log files (Trn.log, Trntmp.log, Trnnnnnn.log, Trnres00001.jrs, Trnres00002.jrs, and Temp.edb) as well as database files (Mail.que and Trn.chk) into new location.Note: If you are having very large mail.que file then you can delete it rather than moving.
  9. Now start the Exchange Transport Server again by running below command:
    net start MSExchangeTransport
  10. Now, at last, verify queue database files as well as transaction log files at a new location, and also make sure that not a single file should be available at an old location.

That’s All what you have to do for getting rid of Mail.que large size / corruption Issue in Exchange 2016/2013/2010/2007.

Conclusion: Mail.que File Large in Size or Corrupted

In this article, we had a discussion about how to overcome from the large mail.que file or mail.que corrupted situation in Exchange Server 2007/2010/2013/2016. There are two different scenarios which are discussed, one for Exchange 2010/2007 Mail.que file and second for Exchange 2013/2016. In the case of Exchange 2007/2010, we have repaired the existing mail.que file at its default location. But in the case of Exchange 2016/2013, we have changed the location or transport database file (mail.que & trn.chk) as well as transaction log files. We can also try repairing the mail.que file in case of Exchange 2013 or Exchange Server 2016 with the help of same used command for Exchange 2007 / 2010.