The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Max hourly emails issue

Discussion in 'E-mail Discussions' started by karlj, Nov 30, 2011.

  1. karlj

    karlj Registered

    Joined:
    Mar 13, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Is cPanel max hourly emails setting really working in latest release (11.30.5)? Someone have been able to send 5000 emails in 1 hour using a PHP script (running on suphp), even if the default is set to 75 emails per hours.

    root@cp1 [~]# grep maxemailsperhour /var/cpanel/cpanel.config
    maxemailsperhour=75
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Scripts have never been bound by using maxemailsperhour setting when the script is using sendmail binary or PHP mail() function that ties into sendmail. This is because sendmail doesn't have the same configuration options as exim, and you don't have the same capabilities for logging and blocking messages for sendmail.
     
  3. karlj

    karlj Registered

    Joined:
    Mar 13, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    That's what I though. Is there any other way to limit email sent from PHP mail()?
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Not that I'm aware. Otherwise, we would be doing it. The way to limit emails is to disallow using PHP mail() function and force them to use SMTP authentication instead.
     
  5. NETLINKIE

    NETLINKIE Registered

    Joined:
    Oct 10, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I have a cPanel server, and max hourly emails is set to 30. This limit also works for sendmail and PHP's mail() function without problems. I use suPHP, I'm not sure if that makes a difference.

    If the limit doesn't work, you might be able to make a sendmail wrapper, especially if you use suPHP.

    Have a look at this for some inspiration:
    How To Log Emails Sent With PHP's mail() Function To Detect Form Spam | HowtoForge - Linux Howtos and Tutorials

    Another option might be to use the free ConfigServer Firewall for cPanel, which is great in any case, by the way, in my opinion, of course.

    ConfigServer Security & Firewall
     
  6. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    How does one disable PHP mail(), without affecting other cPanel / WHM scripts which still requires mail() to function?
     
  7. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Can anyone answer this please?
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    What cPanel / WHM scripts require mail() to function? Mailman and webmail require authenticating and use SMTP. The notification emails in WHM might require it due to using cron jobs, but you may be able to set crons to use something besides sendmail.

    For security, you do have to find workarounds, which I've brought up before in other threads. If you want something to be more secure, you have to either give up some functions or find workarounds for those functions. You cannot have everything work exactly the same and remove options for security.
     
Loading...

Share This Page