Alert on forwarders' changed

ebizindia

Well-Known Member
Oct 13, 2005
96
3
158
Kolkata, India
cPanel Access Level
Root Administrator
Hi

As a root level user, is there a way to set up an alert whenever any domains forwarders are changed.

The reason I ask for this is that some hackers are setting forwarders on users' account, watching their emails and then asking their clients to pay to the hackers' accounts instead of the clients.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello @ebizindia,

There's no direct feature to alert you when a new forwarder is created or modified, but you could develop a custom script to send you a notification and then setup a post-stage hook that runs your custom script immediately after a forwarder is created or modified.

You can find the specific API function to hook into by enabling "Debug mode is on. The system displays information about every stage for every hookable event, even if no hooks exist for that stage." under the "Development" tab in "WHM >> Tweak Settings". Then, perform the specific action you want to hook into via cPanel or WHM, and watch the output in /usr/local/cpanel/logs/error_log.

For example, the following cPanel API 2 function is the hook event to utilize when creating a hook for the addition of a new domain using cPanel >> Addon Domains:

Cpanel::Api2::AddonDomain::addaddondomain

The following links are a good place to start when learning about hooks:

Tutorial - Create a Standardized Hook - Developer Documentation - cPanel Documentation
Tutorial - How to Setup Standardized Hooks with BASH in cPanel & WHM
Tutorial - How To Automatically Install WordPress On New Accounts

Thank you.
 
  • Like
Reactions: ebizindia