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.

email notify

Discussion in 'E-mail Discussions' started by wicamrada, Aug 10, 2012.

  1. wicamrada

    wicamrada Member

    Joined:
    Jun 1, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Dear all

    Today one of my customer account has sent out email around 1000 message to Verizon.net.
    Does anyone know how to do if I want system sent me an email to notify that which account has send out email more than 1000 message per hour?
     
  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
    Do you have any email limits set in WHM > Tweak Settings for max emails per hour? These aren't emailed to you when someone goes over, but you could check the exim logs for when someone exceeds the number and have it email you to inform you via a cron.
     
  3. wicamrada

    wicamrada Member

    Joined:
    Jun 1, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I had limit it to 1500 emails per hour. How to do if I want it email me to inform vai a cron?
     
  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
    Unfortunately due to the way that the files are formed and the logs are created, it seems you'd probably have to run this cron every minute in crontab -e

    Code:
    echo -e 'MAILTO=email@domain.com\n* * * * * /bin/find /var/cpanel/email_send_limits -maxdepth 1 -mmin 1 | grep max_emails' >> /var/spool/cron/root
    Please replace email@domain.com with the email address that should receive the emails.
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,448
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    ConfigServer firewall should be useful here I think:
    ConfigServer Security & Firewall

     
  6. wicamrada

    wicamrada Member

    Joined:
    Jun 1, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I don't have knowledge in centos. after I run this command it send me a lot email. How can I stop it?
     
  7. 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
    Simply remove the MAILTO=email@domain.com and the line below it in /var/spool/cron/root file. You can edit the file using "vi /var/spool/cron/root" or using the command "crontab -e" in command line.

    You are getting alot of emails b/c people keep exceeding the limit most likely. The command only checks a file last updated a minute prior. On my tests, it only emailed me once for the 1 domain I had exceed and didn't again.
     
  8. wicamrada

    wicamrada Member

    Joined:
    Jun 1, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    When I run those command it send email me like that "/bin/sh: /bin/find: No such file or directory". Could you provide me detail of command should I take for server sending and stop sending email to me.
     
  9. 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 command did you run precisely? Please provide the exact commands you used with the return in command line.
     
  10. wicamrada

    wicamrada Member

    Joined:
    Jun 1, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    echo -e 'MAILTO=srada@wicam.com.kh\n* * * * * /bin/find /var/cpanel/email_send_limits -maxdepth 1 -mmin 1 | grep max_emails' >> /var/spool/cron/root
     
  11. 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
    Didn't you note you wanted to remove that line after adding it because you were receiving too many emails? Please clarify exactly what you are doing. Also, please post the full entry with hostname and error return when running whatever commands you are doing. I ask this as it seems SSH commands aren't well known and I'm uncertain a) if you are logged in as root user properly, b) if the commands are actually being properly run that are being indicated.

    If the full prompt and return in command line is not possible, please provide a screen print. This way we know things aren't being removed. It's difficult to troubleshoot when we don't know whether the command is being properly issued because the full messages aren't being noted.
     
  12. wicamrada

    wicamrada Member

    Joined:
    Jun 1, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    could I contact your via your own email or skype?
     
  13. 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
    At this point, the option you'd have it you cannot remove it from crontab is to submit a ticket to ask us to do so. We cannot, however, run the command for you to add anything that's custom of that nature via our ticket system. Feel free to submit the ticket number here after opening one.

    Tickets can be opened in WHM > Support Center > Contact cPanel

    I also highly suggest hiring someone for assistance going forward if you aren't certain of basic Linux shell commands:

    Sys Admin Services | cPanel App Catalog
     
  14. wicamrada

    wicamrada Member

    Joined:
    Jun 1, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank I will submit ticket.
     
Loading...

Share This Page