Site icon Franky's Web

Exchange 2016 DAG: Queue is getting too big (mail.que)

An Exchange 2016 DAG recently encountered the problem that the mail.que, i.e. the Exchange queue, had grown to over 60 GB. If the mail.que had continued to grow, the hard disk would inevitably have filled up, in which case the Exchange server in question would no longer have been able to deliver mails. The growth could also be observed on the other Exchange servers within the DAG.

Here is a screenshot of the server in question:

The queue database (mail.que) is saved in the following directory by default:

1
C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue

However, a check of the queues using the Exchange Management Shell revealed that there are only a few mails in the queues:

The reason for the growth of mail.que is the Exchange feature "Safety Net" has been set. In this case, the default setting of 2 days was increased to 14 days (maximum). In this case, a copy of all delivered messages was kept in the queue by Safety Net for 14 days.

Safety Net is certainly a helpful Exchange feature, but whether every mail has to be kept in the queue for 14 days just in case a database fails and has to be restored from the data backup is open to question. In the past, people have probably been a little overcautious here.

The default setting (2 days) was restored to prevent the queue database from reaching such sizes again. Here is the corresponding procedure:

The following command can be used to check whether SafetyNet is activated and how long the retention time is:

1
Get-TransportConfig | select ShadowRedundancyEnabled,SafetyNetHoldTime

To restore the default setting of 2 days, the following command can be used:

1
Set-TransportConfig -SafetyNetHoldTime 2:00:00:00

However, the queue database (mail.que) does not automatically become smaller. So if the mail.que is too large, the only thing that helps is to delete the database. This also deletes the mails that are in the Safety Net and mails that are in the queue at the time. You should therefore make sure that no mails from users in the "normal" queues are deleted by mistake.

The procedure for deleting mail.que is as follows:

First, the "Microsoft Exchange Transport" service is stopped

You can now delete the entire "Queue" directory (or rename it first to be on the safe side):

The "Microsoft Exchange Transport" service can now be restarted. The "Queue" directory and its contents are automatically created again.

Exit mobile version