Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Mar 2003
    Posts
    345

    Default MailScanner Quarantine

    Whats the FASTEST way to clear the quarantine items?? I noticed this is piling up pretty darn fast... when I rm it will ask me for each and every one of them.. Is there a just do it command??? So that i dont have to keep marking y y y y y each time??

  2. #2
    Member
    Join Date
    Oct 2001
    Posts
    92

    Default

    Include

    -f

    with the command and it will force the removal without prompting for each file.

    So, if you are in the right directory you can issue

    rm -f *.*

    and it will delete every file within that directory.

    Always excercise caution when using -f as you can't undo what it does.

  3. #3
    Member
    Join Date
    Mar 2003
    Posts
    345

    Default

    Great thanks!

  4. #4
    Member
    Join Date
    Sep 2003
    Posts
    147

    Default

    MailScanner.conf

    # Do you want to store copies of the infected attachments and messages?
    # This can also be the filename of a ruleset.
    Quarantine Infections = no

  5. #5
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Or, you can run the CRON job that comes with MailScanner. If you have the layer1 installation:

    cp /usr/mailscanner/bin/cron/clean.quarantine.cron /etc/cron.daily/.

    Then edit the file in /etc/cron.daily/ and set:
    $disabled = 0;
    $days_to_keep = 30; # set to the number of days you want to keep
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  6. #6
    Member
    Join Date
    Mar 2003
    Posts
    345

    Default

    Nice Chirpy I like that one!!

    Although I do not have a BIN directory in MailScanner.

  7. #7
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Although I do not have a BIN directory in MailScanner
    I can only guess that you're not using the layer1 distribution. Anyway, here's the contents of the file, put it into a file in /etc/cron.daily and then chmod +x the file
    Code:
    #!/usr/bin/perl
    #
    # IMPORTANT NOTE:
    #
    # Change the next line to 0 instead of 1 to enable this script.
    # By default it will be disabled and will not do anything.
    #
    
    $disabled = 1;
    $quarantine_dir = '/var/spool/MailScanner/quarantine';
    $days_to_keep   = 30;
    
    exit if $disabled;
    
    # Standardise the format of the directory name
    die 'Path for quarantine_dir must be absolute' unless $quarantine_dir =~ /^\//;
    $quarantine_dir =~ s/\/$//; # Delete trailing slash
    
    # Now get the content list for the directory.
    opendir(QDIR, $quarantine_dir) or die "Couldn't read directory $quarantine_dir";
    
    # Loop through this list looking for any *directory* which hasn't been
    # modified in the last $days_to_keep days.
    # Unfortunately this will do nothing if the filesystem is backed up using tar.
    while($entry = readdir(QDIR)) {	
    	next if $entry =~ /^\./;
    	$entry = $quarantine_dir . '/' . $entry;
    	system("rm -rf $entry") if -d $entry &&
    	                           -M $entry > $days_to_keep;
    }
    closedir(QDIR);
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  8. #8
    Member
    Join Date
    Mar 2003
    Posts
    345

    Default

    That worked thanks a bunch chirpy. You rock!

  9. #9
    Member
    Join Date
    Mar 2003
    Posts
    345

    Default

    Actually if you dont install the one from layer1 as I did. The file clean.quarantine is already located for us in /etc/cron.daily. Although you must enable it it comes disabled by default.

    Just an FYI out their.

  10. #10
    Member
    Join Date
    Mar 2002
    Posts
    448

    Default

    Quote Originally Posted by Damian
    Include

    -f

    with the command and it will force the removal without prompting for each file.

    So, if you are in the right directory you can issue

    rm -f *.*

    and it will delete every file within that directory.

    Always excercise caution when using -f as you can't undo what it does.
    If you're in /var/spool/MailScanner/quarantine/ you'll need to use rm -Rf *, and not rm -f *.*, because inside /quarantine are lots of non-empty directories which won't be touched by rm -f *.*. AND YES - MAKE F'ING SURE YOU'RE IN /var/spool/MailScanner/quarantine/ before running rm -Rf * OR ELSE EVERYTHING (directories, sub directories, files, etc.) IS GOING TO BE DELETED (NO 'ARE YOU SURE', NO 'RECYCLE BIN')!!!
    • Web Design Perth .:. Itomic Business Website Solutions of Perth, Western Australia

Similar Threads & Tags
Similar threads

  1. /quarantine build up
    By reanim in forum E-mail Discussions
    Replies: 0
    Last Post: 01-13-2009, 06:29 PM
  2. /var/spool/MailScanner/quarantine build-up
    By Stanleytiew in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 07-10-2006, 11:36 AM
  3. mailscanner mailwatch quarantine release
    By Lyttek in forum cPanel Developers
    Replies: 6
    Last Post: 03-12-2006, 07:11 PM
  4. clear mailscanner quarantine
    By radical in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-29-2005, 03:09 AM
  5. Release mail from mailscanner quarantine?
    By knipper in forum cPanel and WHM Discussions
    Replies: 16
    Last Post: 10-09-2004, 09:54 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube