Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, September 4, 2019 3:14 PM
Hi all,
I'm facing back pressure issue due to the volume which stores email queue reaches its storage limit.
When I look for datas that consume storage space, I find the folder "Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp\UnifiedContent".
I found on Google that this folder would be related to Exchange Antispam engine.
Well, my 2 questions :
- Is it normal this folder is not automatically purged ?
- Can I remove old files in this folder ?
Thank you.
Regards,
FXE
All replies (12)
Monday, September 16, 2019 1:30 AM âś…Answered | 1 vote
Hi FXE,
The only way to get a smaller mail.que is to rebuild it.
You can rebuild the mail.que via the following steps:
1. Run the following command and make a note from the count of messages on the server:
Get-Queue
2. Pause Microsoft Exchange Transport service from Services tool.
3. Run Get-Queue again and make sure that the queues are empty.
4. If the queues are empty, then you can stop the Microsoft Exchange Transport service.
5. Move all files inside the C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue folder into a backup folder.
6. Restart Microsoft Exchange Transport service.
7. Run Get-Queue again to make sure that the queues and mail flow are working as expected.
For more details, you can check: [RESOLVED] Exchange 2013/2016 hub transport Mail.que file large in size
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
Regards,
Lydia Zhou
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].
Wednesday, September 4, 2019 5:55 PM
Is it normal this folder is not automatically purged ?
It is, but it's probably not being purged as regularly as you would like. How old is the oldest file?
Can I remove old files in this folder ?
Yes. The folder contains a copy of every attachment received by the server and is stored there for malware scanning. It's actually the Malware scanner and not antispam in Exchange that saves the files.
As for backpressure, you may want to consider lowering the Shadow Recovery period to reduce the size of your mail.que file to keep that issue from occurring as often if you have a DAG with multiple active servers. mail.que will store a copy of every email destined for the other servers in the DAG to allow for recovery and re-delivery if one server fails. The default value is pretty high.
Also, you may want to get a maintenance window going to re-initialize the mail.que file. It's a database file that doesn't shrink once it expands, so flushing the mail queue, stopping transport services, deleting the file, the starting transport will do the job and your mail.que file will be significantly smaller for a while. It'll eventually grow back up to the same size, but it takes a very long time for that to happen.
Wednesday, September 4, 2019 7:10 PM
Thank you for your answer Adam,
The oldest file is 7 months old.
Should I keep one or 2 months, if it makes sense of course ?
I will take a look to Shadow Recovery period and mail.que maintenance.
Regards,
FXE
Thursday, September 5, 2019 8:42 AM
Hi Adam,
I'm trying to find anything about Shadow Recovery on Google, but nothing about that.
Can you precise me where I can manage this feature please ?
Thank you.
FXE
Thursday, September 5, 2019 9:30 AM
Hi FXE,
Agree with Adam C Brown and add more information.
You can use the following command to disable the malware agent:
cd $exscripts
.\Disable-Antimalwarescanning.ps1
Restart Microsoft Exchange Information Store service and move logs to other places.
Then enable the malware agent again, and restart Microsoft Exchange Information Store service:
cd $exscripts
.\Enable-Antimalwarescanning.ps1
Additionally, here is a blog about shadow redundancy, you may get useful information from it: Shadow redundancy in Exchange Server
Regards,
Lydia Zhou
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].
Thursday, September 5, 2019 4:48 PM
Hi Lydia and thank you for your answer.
After reading the article about Shadow Redundancy, I think the default settings (at most 4 days of retention) are adapted to our environment.
In fact, I simply want to know if I can remove more than 1 month old files located in the UnifiedContent folder safely and if I have to do other actions related to this operation, before and after.
I equally want to know how can I script mail.que purge.
Thank you.
Regards,
FXE
Monday, September 9, 2019 8:50 AM
Hi FXE,
Yes, you can remove old logs in the UnifiedContent folder. As I mentioned above, you can disable the malware agent before removing these logs.
We suggest you make the backup before deleting these logs. You also can move old logs to other places and monitor for some days. If everything goes well, you can delete them later.
What does "script mail.que purge" mean? Do you mean use cmdlet to delete logs?
If so, you can use the following command to delete logs older than 30 days:
forfiles /p <logs location> /s /m *.log /d -14 /c "cmd /c del @path"
For reference: Delete old logs on Exchange servers
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
Regards,
Lydia Zhou
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].
Saturday, September 14, 2019 10:38 AM
Hi Lydia,
In fact, what I'm looking for is a way to safely "shrink" mail.que as proposed bay Adam :
Also, you may want to get a maintenance window going to re-initialize the mail.que file. It's a database file that doesn't shrink once it expands, so flushing the mail queue, stopping transport services, deleting the file, the starting transport will do the job and your mail.que file will be significantly smaller for a while. It'll eventually grow back up to the same size, but it takes a very long time for that to happen.
Regards,
FXE
Wednesday, September 18, 2019 12:31 PM
Thank you for all these informations Lydia.
Last question I hope : should I do these actions on both of my Exchange server DAG members or can do this action one by one ?
Regards,
FXE
Friday, September 20, 2019 5:36 AM | 1 vote
Hi FXE,
You can rebuild the mail.que for your DAG members one by one. Since you have to stop Microsoft Exchange Transport service, you should do this during the free time.
Regards,
Lydia Zhou
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].
Tuesday, September 24, 2019 7:39 AM
Hi Lydia and thank you for your answer.
Making a PS script to do all these actions automatically, I observed that while renaming all files located in in SmtpQueue folder, only one is not renamed : "tmp.edb" and no error is reported by my script about renaming failed.
Is it normal ? May that file is dynamically deleted and created with Transport service stop and start operations ?
Regards,
FXE
Friday, September 27, 2019 8:12 AM
Hi FXE,
You don't have to rename other files to rebuild the mail.que. Additionally, Tmp.edb is used to verify the queue database schema on startup, you don't have to rename it.
Regards,
Lydia Zhou
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact [email protected].