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);



LinkBack URL
About LinkBacks
Reply With Quote




