Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

cPanel Universal Password Trap Problem

Discussion in 'cPanel Developers' started by mtbwacko, Nov 10, 2009.

  1. mtbwacko

    mtbwacko Well-Known Member

    Nov 30, 2004
    Likes Received:
    Trophy Points:
    I've spent hours on this issue but to no avail. It's a simple script using the Universal Password Trap to send me an email when a password is changed in cPanel. It outputs just fine if run from the shell, but it is not being called when a password is changed. I have the script in the right place according to the documentation (/usr/local/cpanel/Cpanel/ChangePasswd/, but it is not executed when a password is changed. Can anyone help me with this? I must be missing something. Thanks!


    use strict;
    package Cpanel::ChangePasswd::SendtoBilling;

    my %OPTS = @_;
    my $username = $OPTS{'user'};
    my $password = $OPTS{'newpass'};
    my $mailAddy = '****@****.com';

    open (MAIL, "|/usr/sbin/sendmail -t") or die "\nReason: $!";
    print MAIL ("From: $mailAddy\n");
    print MAIL ("Subject: Password Change\n");
    print MAIL ("To: $mailAddy\n\n");
    print MAIL ("Username: $username\nNew Password: $password\n\n");
    close (MAIL);
    #1 mtbwacko, Nov 10, 2009
    Last edited: Nov 10, 2009

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice