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.

cPanel Universal Password Trap Problem

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

  1. mtbwacko

    mtbwacko Well-Known Member

    Joined:
    Nov 30, 2004
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    6
    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/SendtoBilling.pm), but it is not executed when a password is changed. Can anyone help me with this? I must be missing something. Thanks!

    #!/usr/bin/perl

    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
Loading...

Share This Page