Hi All,

I am running Exim with Cpanel/WHM, and I am wondering how to chagne the 
behavious of exim Discarding message if a user is over the max emails per hour 
setting, to queue the messages instead. Here is the pertinent code from exim.pl 
see bolded section specifically. 


#logsmtpbw here
   my $now = time();
   $domain =~ s/[^\w\.\-]//g;
#we just can't trust user input
   my $message_size = Exim::expand_string('$message_size');

   if ($domain ne "") {
      my $maxmails = 0;

      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";
         }
      }

How can i change this so that it queued instead of discarded.

Thanks

John
-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to