Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    4

    Default Domain Specific maximum limit for emails

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

    **********************************************************************

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Yup, I documented this some months ago
    http://forums.cpanel.net/showthread.php?t=35153
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Similar Threads & Tags
Similar threads

  1. Domain limit per hour X emails per connection
    By Arvy in forum E-mail Discussions
    Replies: 0
    Last Post: 03-02-2009, 10:45 PM
  2. Ban emails going to an specific domain
    By Heritz in forum E-mail Discussions
    Replies: 4
    Last Post: 05-28-2008, 03:35 PM
  3. Limit the maximum number of each domain can send out per hour
    By seeyes in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 10-06-2005, 06:50 PM
  4. restricting a specific domain from sending emails
    By nickb in forum New User Questions
    Replies: 5
    Last Post: 05-03-2005, 04:30 AM
  5. maximum emails per domain
    By cyberspirit in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 12-06-2003, 04:08 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube