یه راه هست ولی باید مراقب باشی Cpanel که update می شه اونو حذف نکنه
مراحل زیر رو یکی یکی دنبال کن:
1- اول از همه یه کپی از فایل زیر بگیر
2- خوب توی همین فایل کد زیر رو پیدا کن
کد:
if ( $maxmails > 0 ) {
my $nummailsinhour = readbacktodate("/usr/local/apache/domlogs/$domain-smtpbytes_log");
if ( $nummailsinhour > $maxmails ) {
die "Domain $domain has exceeded the max emails per hour. Message discarded.\n";
}
}
و تغییرات زیر رو انجام بدید
کد:
if ($maxmails > 0) {
my $nummailsinhour = readbacktohour("/usr/local/apache/domlogs/$domain-smtpbytes_log");
my $nummailsinday = readbacktodate("/usr/local/apache/domlogs/$domain-smtpbytes_log");
if ($nummailsinhour > 500) {
die "Domain $domain has exceeded the max emails per hour. Message discarded.\n";
}
if ($nummailsinday > $maxmails) {
die "Domain $domain has exceeded the max emails per day. Message discarded.\n";
}
}
3- حالا خط زیر رو پیدا کنید
و با خط زیر عوض کنید
4- حالا sub کلاس زیر رو بعد از sub قبلی اضافه کن
کد:
sub readbacktodate {
my($filename) = @_;
my($buf);
my($filepos) = 0;
my $now = time();
my $onedayago = ($now - (24*60*60));
my($hitcount) = 0;
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename);
$filepos = ($size - 4096);
open(RF,"$filename");
seek(RF,$filepos,0);
while($filepos >= -4096) {
if ($filepos < 0) {
read(RF,$buf,($filepos+4096));
} else {
read(RF,$buf,4096);
}
if ($filepos > 0) {
$buf =~ /([^\n]+\n)/;
$filepos += length($1);
$buf = substr($buf,length($1));
}
my @BUF = split(/\n/, $buf);
foreach (reverse @BUF) {
my($ttime,$tbytes) = split(/ /);
if ($ttime > $onedayago) {
$hitcount++;
}
}
$filepos -= 4096;
if ($filepos < 0) {
seek(RF,0,0);
} else {
seek(RF,$filepos,0);
}
}
return($hitcount);
}
حالا تو whm قسمت تعداد ایمیل در ساعت به تعداد ایمیل در یک روز گذشته تبدیل شد
موفق باشی