noticed something useful in /etc/exim.pl
===============================================
open(CF,"/var/cpanel/cpanel.config");
while(<CF>) {
next if (/^#/);
s/\n//g;
my($var,$value) = split(/=/, $_);
if ($var eq "maxemailsperhour") {
$maxmails = int($value);
}
}
close(CF);
open(CPM,"/var/cpanel/maxemails");
while(<CPM>) {
s/\n//g;
my($mdomain,$mmax) = split(/=/);
if ($mdomain eq $domain) {
$maxmails = int($mmax);
}
}
close(CPM);
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";
}
}
=====================================================
Looks like it checks if there is a maximum limit for outgoing mails set for particular domain. I believe there is no option in main WHM to set this. If this code was like the one below and we have a /var/cpanel/maxemails , cant we
set maximum out going limit for each domain.
****************************************************************************************
my $nummailsinhour = readbacktodate("/usr/local/apache/domlogs/$domain-smtpbytes_log");
open(CF,"/var/cpanel/cpanel.config");
while(<CF>) {
next if (/^#/);
s/\n//g;
my($var,$value) = split(/=/, $_);
if ($var eq "maxemailsperhour") {
$maxmails = int($value);
}
}
close(CF);
if ($maxmails > 0) {
if ($nummailsinhour > $maxmails) {
die "Domain $domain has exceeded the max emails per hour. Message discarded.\n";
}
}
open(CPM,"/var/cpanel/maxemails");
while(<CPM>) {
s/\n//g;
my($mdomain,$mmax) = split(/=/);
if ($mdomain eq $domain) {
$maxmails = int($mmax);
}
}
close(CPM);
if ($maxmails > 0) {
if ($nummailsinhour > $maxmails) {
die "Domain $domain has exceeded the max emails per hour. Message discarded.\n";
}
}
**********************************************************************



LinkBack URL
About LinkBacks
Reply With Quote





