Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,117
    cPanel/Enkompass Access Level

    Root Administrator

    Question Auto-limiting outgoing email via localhost/PHP

    Does anyone have any ideas on how to limit email via localhost? This is about preventing spam from new signups; I want to prevent new users from sending outgoing spam email via localhost and one simple way of doing that seems to me would be rate-limiting new users' outgoing email when it is sent via localhost. Email sent via PHP script or similar would always come from localhost, whereas real email sent from a mail client such as Outlook would always come in from an external source. Very few customers are going to want to send much outgoing email via localhost anyway, as far as I can see.

    What I'd like to do is limit new customers to say 20 emails a day from localhost. If they exceed that threshold I'd like to keep a copy of their localhost email for inspection - that way I can tell easily whether they're a spammer or not.

    Has anyone implemented something like this? I'm just thinking this shouldn't be that hard to implement and it would let me sleep like a babe in arms, knowing that auto-signup wouldn't bite me in the bum... I know very little about Exim though, mainly having been a qmail and sendmail boy.

    Anyone got any ideas on how I could attack this?

    Thanks,

    Brian

  2. #2
    Member
    Join Date
    Jun 2005
    Posts
    8

    Default

    Quote Originally Posted by brianoz
    Does anyone have any ideas on how to limit email via localhost? This is about preventing spam from new signups; I want to prevent new users from sending outgoing spam email via localhost and one simple way of doing that seems to me would be rate-limiting new users' outgoing email when it is sent via localhost. Email sent via PHP script or similar would always come from localhost, whereas real email sent from a mail client such as Outlook would always come in from an external source. Very few customers are going to want to send much outgoing email via localhost anyway, as far as I can see.

    What I'd like to do is limit new customers to say 20 emails a day from localhost. If they exceed that threshold I'd like to keep a copy of their localhost email for inspection - that way I can tell easily whether they're a spammer or not.

    Has anyone implemented something like this? I'm just thinking this shouldn't be that hard to implement and it would let me sleep like a babe in arms, knowing that auto-signup wouldn't bite me in the bum... I know very little about Exim though, mainly having been a qmail and sendmail boy.

    Anyone got any ideas on how I could attack this?

    Thanks,

    Brian
    This is a must. Phishing is out of control. Something needs to be done. Is there a way to limit the amount of emails sent through sendmail and smtp on an hourly basis?

  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge AndyReed's Avatar
    Join Date
    May 2004
    Location
    Minneapolis, MN
    Posts
    2,223

    Default

    Login to WHM >> Tweak Settings >> The maximum each domain can send out per hour (0 is unlimited)
    Andy Reed
    RHCE and CCNA
    ServerTune.com

  4. #4
    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

    Yes, there is. It's only a must if you're unlucky/don't properly vet your customers before allowing them on your server.

    You can limit emails on an hourly basis for all domains with the emails per hour setting in WHM > Tweak Settings. Or you can do it on a per domain basis, if you want to do it for new domains only, by following the procedure in my post here:
    http://forums.cpanel.net/showpost.ph...1&postcount=11
    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

  5. #5
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,117
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    I use the WHM limit to keep the limit down for all domains and only specifically enable those domains that ask for it. We have less than 1% of our users interested in sending out large numbers of emails, and I like leaving it disabled permanently so as to make it harder for spammers.

    Of course, the other way around works well too, so long as you lift the restrictions on new users automatically, or remember to do it!

  6. #6
    Member
    Join Date
    Apr 2004
    Posts
    14

    Default nobody mail seems to be exempt

    I have the /var/cpanel/maxemails feature in place, and it works for user domains, but it doesn't seem to place any limit on the nobody@servername mail that goes out.

    After noticing that, I limited the nobody mail to 500/hr and that still had no effect. The default in Tweak Settings is 250.

    Does anyone know of a separate setting for this? I've looked everywhere I know.

    Thanks!

  7. #7
    Member
    Join Date
    Apr 2004
    Posts
    14

    Default nevermind

    Nevermind - I found the other discussion - should have looked a little deeper.

  8. #8
    Member danimal's Avatar
    Join Date
    Jul 2003
    Posts
    79

    Default url?

    ilbin,

    Can you post the link to the other discussion you were referring to? I'm still looking, although my needs are slightly different, but I need to understand php and mail sending and limits.

    Thanks!

    -Danimal

Similar Threads & Tags
Similar threads

  1. Auto create email with PHP
    By bwor in forum cPanel Developers
    Replies: 17
    Last Post: 09-28-2011, 12:08 AM
  2. Rate limiting outgoing email for users
    By tywe in forum E-mail Discussions
    Replies: 3
    Last Post: 09-02-2009, 10:51 PM
  3. Rate-limiting outgoing e-mail
    By danf in forum E-mail Discussions
    Replies: 3
    Last Post: 05-05-2009, 08:30 AM
  4. Limiting auto-whitelist disk usage (AWL) in SpamAssassin
    By pubwvj in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 07-02-2005, 10:57 AM
  5. Exim outgoing smtp - How to verify From: header for localhost?
    By MattF in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-17-2004, 01:02 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube