Mail.queue DB file is increasing continuously

I am using exchange 2016, its Mail.queue is located on C drive it is continously increasing due to which some times fail flow stopped and after restarting exchange services, it works. Current size is more than 14 GB. I have some of client who are using exchange 2010 and exchange 13, their mail.queue never increase while they have many mailboxes than this. I decreased Safety net time and other thing but stilll increasing. I followed below links.

Every time, Recreating Mail.queue is not possible for.
Arif KhanSystem AdministratorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sunil ChauhanConsultant Commented:
Arif KhanSystem AdministratorAuthor Commented:
I do not want to change the mail.queue location.

I want to stop its increasing size. Generally if mail is processed, it should automatically get release from Mail.queue but I think either this is not happening or happening very late. I need your support to fix large size 14 GB of mail.queuque
Sunil ChauhanConsultant Commented:
I hope you have already tried the option to restrict the safety Net hold time.

for your information, this seems to be expected behavior and if its growing usually faster then your best option is to move it to a different drive with more space.
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

E ATech LeadCommented:
May be any third party antivirus/antispam acting on the queue db and causing it to grow.

Also, check if there are any large  attachments stuck in outbox which will cause the db's transport and mdb's to grow in a larger size.

Monitor your queue for any bundles of spam mails.

Get in detailed here:

Hope this helps!
Arif KhanSystem AdministratorAuthor Commented:
Thank you for your support.

I am trying below.......

To this issue, please refer to the following steps to check if the issue persist:

1. Lower Down the Values of SafetyNetHoldTime, ShadowMessageAutoDiscardInterval, MessageExpirationTimeout

Set-TransportConfig SafetyNetHoldTime 1.00:00:00 >> 1-Day

Set-TransportConfig ShadowMessageAutoDiscardInterval 1.00:00:00  >> 1-Day

Get-TransportService | Set-TransportService -MessageExpirationTimeout 1.00:00:00 >> 1-Day

2. To ensure that transport databases recover the whitespace efficiently, added below keys on Exchange 2016  Edgetransport.exe.Config file in the “C:\Program Files\Microsoft\Exchange Server\V15\Bin”

<add key="QueueDatabaseOnlineDefragSchedule" value="1:00:00" />

<add key="QueueDatabaseOnlineDefragTimeToRun" value="3:00:00" />

<add key="QueueDatabaseOnlineDefragEnabled" value="true" />

3. Restart the transport service.
Arif KhanSystem AdministratorAuthor Commented:
After above issue, i faced the same issue. I have logged the case with Microsoft, they export mails stuck in OUTBOX using below command. Some heavy size mails were stuck in queue. Deleted it. and recreated QUEUE folder.

get-mailbox -ResultSize Unlimited| Get-MailboxFolderStatistics -folderscope Outbox | Sort-Object Foldersize -Descending | select-object identity,name,foldertype,itemsinfolder,@{Name="FolderSize MB";expression={$_.folderSize.toMB()}} | export-csv OutboxItems.csvget-mailbox -ResultSize Unlimited| Get-MailboxFolderStatistics -folderscope Outbox | Sort-Object Foldersize -Descending | select-object identity,name,foldertype,itemsinfolder,@{Name="FolderSize MB";expression={$_.folderSize.toMB()}} | export-csv OutboxItems.csv

They suggested that in exchange 2010 mail.queue size is 2 GB and exchange 2013/16 its 15 GB. So no worry till 15 GB. I am waiting to grow it more. Will share the steps
Arif KhanSystem AdministratorAuthor Commented:
1. Deleted all stuck mail in outbox
2. Set mail flow size to 30 MB for all users
3. Reduced Safety net, Autoshadow, Message expiration from 2 days to 1 day
4. Added defrag key in EdgeTransport.exe.config file
5. Add safety net clear value in EdgeTransport.exe.config file
6. Re-created QUE folder

<add key="SafetyNetHoldTimeInterval" value="1.00:00:00" />

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Arif KhanSystem AdministratorAuthor Commented:
This fixed the problem
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.