Server IP : 221.132.30.236 / Your IP : 216.73.216.91 [ Web Server : Apache System : Linux web3.trangwebvang.net 2.6.32-954.3.5.lve1.4.86.el6.x86_64 #1 SMP Tue Aug 31 17:08:39 UTC 2021 x86_64 User : cherishhotel ( 944) PHP Version : 5.6.40 Disable Function : exec, system,passthru,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice, proc_terminate, proc_get_status, proc_close, pfsockopen, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid,dl,symlink Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /scripts/ |
Upload File : |
#!/usr/local/cpanel/3rdparty/bin/perl # cpanel - scripts/fixvaliases 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 use strict; use warnings; use Cpanel::ConfigFiles (); use Cpanel::PwCache (); use Cpanel::Email::Constants (); use Cpanel::Email::Perms (); require "/usr/local/cpanel/scripts/safetybits.pl"; ## no critic qw(RequireBarewordIncludes) my $mailgid = ( Cpanel::PwCache::getpwnam('mail') )[3]; opendir( CPU, "/var/cpanel/users" ); my @USERS = readdir(CPU); closedir(CPU); my $dns = ''; foreach my $file (@USERS) { next if ( !getpwnam($file) ); my @UNFO = getpwnam($file); my $homedir = $UNFO[7]; if ( $homedir ne "" ) { if ( -d "$homedir/mail" ) { safe_chmod( $Cpanel::Email::Perms::MAILDIR_PERMS, "$file", "${homedir}/mail" ); safe_chmod( 0660, "$file", "${homedir}/mail/inbox" ); } } if ( -f "$Cpanel::ConfigFiles::cpanel_users/$file" ) { open( F, "$Cpanel::ConfigFiles::cpanel_users/$file" ); while (<F>) { if (/^DNS=(\S+)/) { $dns = $1; } } close(F); if ( $dns ne "" ) { print "Fixing $dns....\n"; open( VA, ">>", "$Cpanel::ConfigFiles::VALIASES_DIR/$dns" ); close(VA); open( VF, ">>", "$Cpanel::ConfigFiles::VFILTERS_DIR/$dns" ); close(VF); chown $UNFO[2], $mailgid, "$Cpanel::ConfigFiles::VALIASES_DIR/$dns"; chown $UNFO[2], $mailgid, "$Cpanel::ConfigFiles::VFILTERS_DIR/$dns"; chmod Cpanel::Email::Constants::VFILE_PERMS(), "$Cpanel::ConfigFiles::VALIASES_DIR/$dns"; chmod Cpanel::Email::Constants::VFILE_PERMS(), "$Cpanel::ConfigFiles::VFILTERS_DIR/$dns"; $dns = ''; } } }