{"id":279,"date":"2025-04-15T13:08:09","date_gmt":"2025-04-15T11:08:09","guid":{"rendered":"https:\/\/www.24x7serverguard.com\/blog\/?p=279"},"modified":"2025-04-15T13:08:09","modified_gmt":"2025-04-15T11:08:09","slug":"%f0%9f%9b%91-how-to-disable-auto-delete-emails-from-trash-after-7-days-in-courier-imap","status":"publish","type":"post","link":"https:\/\/www.24x7serverguard.com\/blog\/cpanel\/%f0%9f%9b%91-how-to-disable-auto-delete-emails-from-trash-after-7-days-in-courier-imap\/","title":{"rendered":"\ud83d\uded1 How to Disable Auto-Delete Emails from Trash After 7 Days in Courier-IMAP"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Are your email users running out of space even though their inboxes are empty? The culprit is often the <strong>Trash folder<\/strong>, where deleted emails quietly pile up. By default, <strong>Courier-IMAP<\/strong> may be configured to automatically delete emails in the Trash folder after 7 days.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this post, we\u2019ll show you <strong>how to disable or change this setting<\/strong> on your server, ensuring no emails are deleted from Trash unless the user manually clears them.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udccc Why This Matters<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">On shared or corporate mail servers, automatic trash deletion can be helpful to keep storage usage in check. But sometimes, important emails might remain in Trash longer than 7 days \u2014 and get deleted unexpectedly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Disabling this setting gives users more control over their email retention.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddf0 Step-by-Step: Disable Auto Trash Purge in Courier-IMAP<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Step 1: Log in via SSH<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use root access to log into your server:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">ssh root@your-server-ip<\/mark><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Step 2: Edit the Courier-IMAP Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open the <code>imapd<\/code> configuration file in your favorite editor (we\u2019ll use <code>vi<\/code> here):<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">vi \/usr\/lib\/courier-imap\/etc\/imapd<\/mark><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Step 3: Locate the Auto Trash Purge Setting<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Search for the line that begins with:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">IMAP_EMPTYTRASH<\/mark><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It may look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">IMAP_EMPTYTRASH<\/mark>=Trash:<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">7<br><\/mark>This means emails in the Trash folder are automatically deleted after 7 days.<br><br>\u2705 Step 4: Disable or Modify the Setting<br>To disable auto-deletion, simply comment it out by adding a # in front of the line:<br><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-cyan-bluish-gray-color\">#IMAP_EMPTYTRASH=Trash:7<\/mark><br><br>Alternatively, you can set it to a different number of days (e.g., 30 days):<br><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-cyan-bluish-gray-color\">IMAP_EMPTYTRASH=Trash:30<br><br><\/mark><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Step 5: Restart Courier-IMAP<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Apply the changes by restarting the Courier-IMAP service:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-cyan-bluish-gray-color\">service courier-imap restart<\/mark><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83c\udf89 You\u2019re Done!<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now, emails in the Trash folder will <strong>no longer be deleted automatically after 7 days<\/strong>, unless you\u2019ve set a different time limit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This gives your users more flexibility and avoids accidental email loss due to hidden auto-cleanup settings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83e\udde0 Pro Tip:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Encourage users to <strong>manually empty their Trash folders<\/strong> periodically to manage space usage, especially on shared servers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are your email users running out of space even though their inboxes are empty? The culprit is often the Trash folder, where deleted emails quietly pile up. By default, Courier-IMAP may be configured to automatically delete emails in the Trash folder after 7 days. In this post, we\u2019ll show you how to disable or change [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":280,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[264,266,265],"class_list":["post-279","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel","tag-auto-delete-emails","tag-courier-imap","tag-trash"],"_links":{"self":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/comments?post=279"}],"version-history":[{"count":1,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/279\/revisions"}],"predecessor-version":[{"id":281,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/279\/revisions\/281"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/media\/280"}],"wp:attachment":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/media?parent=279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/categories?post=279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/tags?post=279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}