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.

Script triggered on removal of DNS zone?

Discussion in 'cPanel Developers' started by charlesd, May 27, 2010.

  1. charlesd

    charlesd Registered

    Joined:
    May 27, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi all,

    I'm integrating cPanel with our external spam filters and need a way to capture DNS zones as they're removed (likely through account termination) so I can remove the domain from our spam filters. I've checked the existing script hooks and thought /scripts/postkillacct would give me what I need, but it just tells me the username and that DNS was killed, but not what the actual domain that was removed.

    Am I missing something here? Is there an easy way via the scripts to get the domains removed when an account has been terminated?

    Thanks,
    -charles
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi Charles,

    Have you considered a prekillacct script? You could take the user name from that, look up the zone, then store it in a tmp file. Then, have a postkillacct that looks for the tmp file, reads the zone and does the remove-filter action; remove the tmp file.

    I suppose you could do it all in the prekillacct, but by doing the remove-filter action in the postkillacct you're know for sure that the account no longer should exist and it's safe to remove the filter.

    Regards,
    -David
     
Loading...

Share This Page