Ganteng Doang Upload Shell Gak Bisa


Linux server.jmdstrack.com 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
/ scripts/

//scripts/remove_dovecot_index_files

#!/usr/local/cpanel/3rdparty/bin/perl

# cpanel - scripts/remove_dovecot_index_files      Copyright 2022 cPanel, L.L.C.
#                                                           All rights reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

package scripts::remove_dovecot_index_files;

use strict;

use File::Find   ();
use File::Spec   ();
use Getopt::Long ();

use Cpanel::Config::LoadCpConf           ();
use Cpanel::PwCache                      ();
use Cpanel::Reseller                     ();
use Cpanel::Config::Users                ();
use Cpanel::Config::LoadUserOwners       ();
use Cpanel::AccessIds::ReducedPrivileges ();

exit run(@ARGV) unless caller();

my $verbose = 0;

sub run {
    my @cmdline_args = @_;
    return usage(1) if !@cmdline_args;

    unless ( $> == 0 && $< == 0 ) {
        return usage( 1, "[!] This program can only be run by root!\n" );
    }

    my $opts = {};
    Getopt::Long::GetOptionsFromArray(
        \@cmdline_args,
        'all'         => \$opts->{'all'},
        'reseller=s@' => \$opts->{'reseller'},
        'user=s@'     => \$opts->{'user'},
        'verbose'     => \$verbose,
        'help|h'      => \$opts->{'help'},
    );

    return usage(0) if $opts->{'help'};

    my $cpconf_ref = Cpanel::Config::LoadCpConf::loadcpconf();
    if ( $cpconf_ref->{'mailserver'} ne 'dovecot' ) {
        return usage( 1, "[!] The configured mailserver is not Dovecot. Action aborted.\n" );
    }

    return process_all_users_on_server()    if $opts->{'all'};
    process_reseller( $opts->{'reseller'} ) if $opts->{'reseller'} && scalar @{ $opts->{'reseller'} };
    process_cpanel_user( $opts->{'user'} )  if $opts->{'user'}     && scalar @{ $opts->{'user'} };

    return 0;
}

sub process_cpanel_user {
    my $cpusers_to_process = shift;

    my ( $index, $total ) = ( 1, scalar @{$cpusers_to_process} );
    foreach my $cpuser ( @{$cpusers_to_process} ) {
        print "[*] ($index/$total) Processing cPanel user: '$cpuser' …\n";

        $index++;
        my $homedir = Cpanel::PwCache::gethomedir($cpuser);
        my $maildir = File::Spec->catfile( $homedir, 'mail' );
        if ( !-d $maildir ) {
            print "[!] User's maildir was not found: $maildir - $!\n";
            next;
        }

        my $maxdepth                 = File::Spec->splitdir($maildir) + 4;
        my $purge_index_files_codref = sub {
            File::Find::find(
                {
                    'wanted' => sub {

                        # Dovecot index files are in "$homedir/mail/domain.tld/emailuser/<dirname>".
                        # So we limit the depth here to what was determined above.
                        return if File::Spec->splitdir($File::Find::name) > $maxdepth;

                        # Remove files that match:
                        # dovecot.index
                        # dovecot.index.cache
                        # dovecot.index.log
                        # dovecot.index.log.\d+ (rotated log files)
                        return if $_ !~ m/^dovecot\.index(\.cache|\.log(\.\d+)?)?$/;

                        print "Unlinking '$File::Find::name' …\n" if $verbose;

                        if ( -e $File::Find::name && -f $File::Find::name ) {
                            unlink $File::Find::name or print "Failed to unlink '$File::Find::name': $!\n";
                        }
                    },
                    'no_chdir'    => 0,    # default, but setting to be explicit about the usage.
                    'follow_skip' => 2,    # ignore any duplicate files and directories
                },
                $maildir
            );
        };
        eval { Cpanel::AccessIds::ReducedPrivileges::call_as_user( $purge_index_files_codref, $cpuser ) };

        print "[+] '$cpuser' processed.\n";
    }
    return;
}

sub process_reseller {
    my $resellers_to_process = shift;

    foreach my $reseller ( @{$resellers_to_process} ) {
        print "[*] Processing Reseller: '$reseller' …\n";
        if ( !Cpanel::Reseller::isreseller($reseller) ) {
            print "[!] '$reseller' is not reseller.\n\n";
            next;
        }

        my $owners_hr = Cpanel::Config::LoadUserOwners::loadtrueuserowners( {} );
        if ( !( $owners_hr->{$reseller} && 'ARRAY' eq ref $owners_hr->{$reseller} ) ) {
            print "[!] Failed to fetch list of accounts owned by reseller, '$reseller'.\n\n";
            return;
        }

        print "\n";
        process_cpanel_user( $owners_hr->{$reseller} );
        print "\n";
    }

    return;
}

sub process_all_users_on_server {
    my $cpusers = Cpanel::Config::Users::getcpusers();
    if ( !( $cpusers && 'ARRAY' eq ref $cpusers ) ) {
        print "[!] Failed to fetch list of cPanel accounts on server.\n";
        return;
    }

    print "[*] Processing all cPanel users on the server …\n\n";
    process_cpanel_user($cpusers);
    print "\n[+] Finished processing all cPanel users on the server.\n";

    return 0;
}

sub usage {
    my ( $retval, $msg ) = @_;
    my $fh = $retval ? \*STDERR : \*STDOUT;

    if ( !defined $msg ) {
        $msg = <<USAGE;
$0

Utility to remove Dovecot index files. Available options:

    --user [cPanel username]

        Remove Dovecot index files from all email accounts setup under the specified cPanel user.
        Can be specified more than once, to process multiple users at once.

    --reseller [reseller username]

        Remove Dovecot index files from all email accounts setup under all the cPanel accounts owned by the specified Reseller.
        Can be specified more than once, to process multiple resellers at once.

    --all

        Remove Dovecot index files from all email accounts setup on the server.

    --verbose

        Prints the full paths of the files being removed.

    --help

        Prints this help text.
USAGE
    }

    print {$fh} $msg;
    return $retval;
}

1;
			
			


Thanks For 0xGh05T - DSRF14 - Mr.Dan07 - Leri01 - FxshX7 - AlkaExploiter - xLoveSyndrome'z - Acep Gans'z

JMDS TRACK – Just Another Diagnostics Lab Site

Home

JMDS TRACK Cameroon

Boost the productivity of your mobile ressources


Make An Appointment


Fleet management

  1. Reduce the operting cost and the unavailability of your vehicles
  2. reduce the fuel consumption of your fleet
  3. Improve the driving dehavior and safety of your drivers
  4. optimize the utilization rate of your equipment 
  5. protect your vehicle against theft
  6. Improve the quality of your customer service


Find out more

Assets management

  1. Track the roaming of your equipment
  2. Optimise the management of your assets on site and during transport
  3. Secure the transport of your goods
  4. Make your team responsible for preventing the loss of tools, equipment
  5. Take a real-time inventory of your equipment on site
  6. Easily find your mobile objects or equipment



Find out more



Find out more

Antitheft solutions

  1. Secure your vehicles and machinery and increase your chances of recovering them in the event of theft
  2. Protect your assets and reduce the costs associated with their loss
  3. Combine immobiliser and driver identification and limit the risk of theft
  4. Identify fuel theft and reduce costs
  5. Protect your goods and take no more risks
  6. Be alerted to abnormal events

Our Location

 Douala BP cité 

     and

Yaoundé Total Essos


Make An Appointment


Get Directions

682230363/ 677481892

What makes us different from others

  • young and dynamic team
  • call center 24/24 7/7
  • roaming throughout Africa
  • team of developers who can develop customer-specific solutions
  • diversity of services
  • reactive and prompt after-sales service when soliciting a customer or a malfunction
  • Free Maintenance and installation in the cities of Douala and Yaounde

https://youtu.be/xI1cz_Jh2x8

15+
years of experience in GPS system development, production and deployment.

15 Collaborators

More than 15 employees dedicated to the research and development of new applications and to customer care

5 000 Vehicles and mobile assets

5 000 vehicles and mobile assets under management, in Africa

Our Partners










Latest Case Studies

Our current projects 

5/5
Bon SAV , SATISFAIT DU TRAITEMENT DES REQUETES

M DIPITA CHRISTIAN
Logistic Safety Manager Road Safety Manager
5/5
La réactivité de JMDS est excellente
Nous restons satisfait dans l’ensemble des prestations relatives a la couverture de notre parc automobile

Hervé Frédéric NDENGUE
Chef Service Adjoint de la Sécurité Générale (CNPS)
5/5
L’APPLICATION EMIXIS est convivial A L’utilisation
BEIG-3 SARL
DIRECTOR GENERAL
5/5
Nevertheless I am delighted with the service
MR. BISSE BENJAMIN
CUSTOMER

Subsribe To Our Newsletter

Stay in touch with us to get latest news and special offers.



Address JMDS TRACK

Douala bp cité



and

YAOUNDE Total Essos

Call Us

+237682230363



Email Us


info@jmdstrack.cm