Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

mailscanner help

Discussion in 'E-mail Discussion' started by silvernetuk, Feb 1, 2004.

  1. silvernetuk

    silvernetuk Well-Known Member

    Joined:
    Sep 2, 2002
    Messages:
    311
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    United Kingdom
    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. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    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);
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. silvernetuk

    silvernetuk Well-Known Member

    Joined:
    Sep 2, 2002
    Messages:
    311
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    United Kingdom
    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. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #4 chirpy, Feb 1, 2004
    Last edited: May 13, 2004
  5. Creazioni1

    Creazioni1 Well-Known Member

    Joined:
    Dec 28, 2003
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    156
    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
     
    #5 Creazioni1, May 13, 2004
    Last edited: May 13, 2004
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    You need to set:

    $disabled = 0;

    1 = true, 0 = false (fixed my previous post, sorry about that)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Creazioni1

    Creazioni1 Well-Known Member

    Joined:
    Dec 28, 2003
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    156
    to enable i write o?

    i try

    THANKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
     
  8. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    Yes, it should be 0 (zero) :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. jameshsi

    jameshsi Well-Known Member

    Joined:
    Oct 22, 2001
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    316
    Thanks for this thread.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice