Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 17th August 2012, 19:00
EckyBrazz EckyBrazz is offline
Join Date: Jul 2012
Location: Goinia, Brazil
Posts: 37
Thanks: 3
Thanked 4 Times in 1 Post
Default Script to clean up old Trash, Junk and Spam mail.

Hi Folks,

Just found a script that I have adjusted to work with ISPConfig 3 to clean up the old trash mail ect.

MAILDIRS=$(find /var/vmail/*/*/Maildir/ -maxdepth 0 -type d)
for basedir in $MAILDIRS; do
  for dir in .Trash .Junk .Spam .Low\ Priority; do
    for dir2 in cur new; do
      [ -e "$basedir/$dir/$dir2" ] && (
        echo "Processing $basedir/$dir/$dir2..."
        find "$basedir/$dir/$dir2/" -type f -mtime +30 -delete
When migration from Cpanel to ISPconfig I found that my users have a lot of old mails in the trash. When I ran this script it saved me about 25GB of diskspace.
Michael Burgos
Reply With Quote
The Following 4 Users Say Thank You to EckyBrazz For This Useful Post:
falko (18th August 2012), florix.net (21st March 2013), technoid (24th March 2013), till (18th August 2012)
Sponsored Links


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Move Spam Emails to Junk directory by default? Spamfilter = Normal by default? radim_h Tips/Tricks/Mods 4 18th January 2012 00:25
Junk mail folder Rescue9 General 2 23rd March 2010 15:00
imapd: Error reading ACLs for INBOX..Junk: Invalid argument playalistic Installation/Configuration 6 2nd December 2009 12:42
Move junk mail to a folder instead of deleting grant Tips/Tricks/Mods 20 23rd October 2008 00:09
Junk mail and spamassassin... sthompson Installation/Configuration 4 27th December 2006 17:11

All times are GMT +2. The time now is 06:46.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.