MOON
Server: Apache
System: Linux host.communityeducationproject.org 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 i686
User: ohiobwc (508)
PHP: 5.6.23
Disabled: show_source, system, passthru, popen, proc_open, allow_url_fopen
Upload Files
File: //scripts/exim_tidydb
#!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - exim_tidydb                            Copyright(c) 2010 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

use strict;
use File::Glob              ();
use File::Basename          ();
use Cpanel::FindBin         ();
use Cpanel::SafeRun::Errors ();

Cpanel::SafeRun::Errors::saferunnoerror('/usr/local/cpanel/scripts/cleanmsglog');
my $exim_tidydb = Cpanel::FindBin::findbin( 'exim_tidydb', 'path' => [ '/usr/sbin', '/usr/local/sbin', '/usr/bin', '/usr/local/bin', '/usr/exim/bin' ] );
if ( !$exim_tidydb ) { die 'Cannot find exim_tidydb'; }

foreach my $dir (qw(/var/spool/exim_incoming /var/spool/exim)) {
    next if ( !-d $dir );
    my @dbs = File::Glob::glob("$dir/db/*");
    foreach my $db (@dbs) {
        my $time;
        my $basedb = File::Basename::basename($db);
        next if ( $basedb =~ /^\.|\.lock(file)?$/ );
        if ( $basedb =~ /ratelimit/i ) { $time = '1d'; }
        if ($time) {
            system( $exim_tidydb, '-t', $time, $dir, $basedb );
        }
        else {
            system( $exim_tidydb, $dir, $basedb );
        }
    }
}