Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member silvernetuk's Avatar
    Join Date
    Sep 2002
    Location
    United Kingdom
    Posts
    311

    Question mailscanner help

    Hi,

    When mailscanner find a virus it save it on the server under:
    quarantine/DATE/MSG-ID/virusfile.zip

    Do I delete the MSG-ID folder or just the virus file ?

    Also I got MailScanner from CPanel Layer 1 how do I stop/start and restart it as it not a service ?

    Regards,
    Garry

  2. #2
    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

    Garry,

    To answer the second part first, the package from Layer1 should have created ajob in your root crontab to run a check on whether MailScanner is running, and if not start it. It should look something like:

    Code:
    */10 * * * * /usr/mailscanner/bin/check_mailscanner > /dev/null 2<&1
    For the first part. If you'd done the install of MailScanner from source it would have created the following file that cleans your quarantine directory for you. You should create this, as root, in /etc/cron.daily/clean.quarantine

    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 = 0;
    
    $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

  3. #3
    Member silvernetuk's Avatar
    Join Date
    Sep 2002
    Location
    United Kingdom
    Posts
    311

    Default

    Hi,

    So if I ever wanted to stop it for awhile, I would have to remvoe the cron job and kill the task is that right ?

    Regards,
    Garry

  4. #4
    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

    To stop it cleaning the quarantine area edit the script you created and change $disabled = 1; to $disabled = 0;

    The crontab I mentioned is to make sure MailScanner is running. If you disable that (and killall MailScanner) then outgoing email wont' be sent and incoming email won't be delivered to your POP3 accounts.
    Last edited by chirpy; 05-13-2004 at 04:05 PM.
    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

  5. #5
    Member
    Join Date
    Dec 2003
    Posts
    58

    Default

    Don't work


    i do
    pico /etc/cron.daily/clean.quarantine
    and i choose
    $days_to_keep = 1;
    $disabled = 1

    but none file is deleted


    i do something in cron?

    THANKS
    Last edited by Creazioni1; 05-13-2004 at 03:50 PM.

  6. #6
    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

    You need to set:

    $disabled = 0;

    1 = true, 0 = false (fixed my previous post, sorry about that)
    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

  7. #7
    Member
    Join Date
    Dec 2003
    Posts
    58

    Default

    to enable i write o?

    i try

    THANKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

  8. #8
    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

    Yes, it should be 0 (zero)
    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

  9. #9
    Member
    Join Date
    Oct 2001
    Posts
    348

    Default

    Thanks for this thread.

Similar Threads & Tags
Similar threads

  1. Mailscanner
    By erinspice in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 08-04-2007, 08:03 PM
  2. How do you uninstall mailscanner and the mailscanner fe?
    By Darph Bobo in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-13-2007, 10:41 AM
  3. MailScanner??
    By tom_taylor in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 11-29-2006, 04:52 PM
  4. MailScanner?
    By damainman in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-24-2004, 02:04 AM
  5. MailScanner
    By Sash in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-31-2003, 04:12 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube