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.

Way to throttle email sending via .php scripts ?

Discussion in 'E-mail Discussions' started by WebHostDog, Mar 30, 2008.

  1. WebHostDog

    WebHostDog Well-Known Member

    Joined:
    Sep 3, 2006
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Website Owner
    Hello,
    Is it a way to limit the number of emails sent via .php scripts or/and throttle this emailing speed cause in the case of spamer the server load hit the roof. Seems number of emails per hour limit is not working in this case of script emailing.



    Thanks,
     
  2. hostmedic

    hostmedic Well-Known Member

    Joined:
    Apr 30, 2003
    Messages:
    559
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Washington Court House, Ohio, United States
    cPanel Access Level:
    DataCenter Provider
    webhost gear to the rescue

    simple google search came up w/ this -

    http://www.webhostgear.com/index.php?art/id:232

    PHP and Apache has a history of not being able to track which users are sending out mail through the PHP mail function from the nobody user causing leaks in formmail scripts and malicious users to spam from your server without you knowing who or where.

    Watching your exim_mainlog doesn't exactly help, you see th email going out but you can't track from which user or script is sending it. This is a quick and dirty way to get around the nobody spam problem on your Linux server.

    If you check out your PHP.ini file you'll notice that your mail program is set to: /usr/sbin/sendmail and 99.99% of PHP scripts will just use the built in mail(); function for PHP - so everything will go through /usr/sbin/sendmail =)

    hope that helps
     
  3. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Possibly a good concept idea, but in my server, my /usr/sbin/sendmail is a binary file, and this solution cannot be accomplished since it's non editable using pico.
    Is there any other solution? I'm also interested in checking that nobody is actually somebody.
    Regards
     
  4. WebHostDog

    WebHostDog Well-Known Member

    Joined:
    Sep 3, 2006
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Website Owner
    Hello,
    I do not like to track them cause I know who is sending. The aim is to limit them not to overload the server and SPAM before I shut them down. Throttling or/and limit as number per hour.



    Thanks,
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I remember a similar thread on WHT this morning. Is the user sending mail using standard SMTP or mail() calls or are they bypassing your SMTP server entirely?

    The SMTP Tweak (WHM -> Security -> Security Center -> SMTP Tweak) will curb malicious users from bypassing your SMTP server.
     
  6. WebHostDog

    WebHostDog Well-Known Member

    Joined:
    Sep 3, 2006
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Website Owner
    Hello,
    They are sending via .php script with mail function. I am using CSF and LFD. LFD blockes the folder but after it run (every 5 min.). Till then they can send as many emails as they like.



    Thanks,
     
  7. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Odd, typically the mail function routes mail through the SMTP server (by way of sendmail emulation) in a cPanel/WHM environment.
     
  8. WebHostDog

    WebHostDog Well-Known Member

    Joined:
    Sep 3, 2006
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Website Owner
    Hello,
    Yes thats what I am saying if the limit per user or domain works as I have set it in WHM would not be a problem. But seems it is not cause he has sent thousands of emails.


    Thanks,
     
Loading...

Share This Page