I have run into this bug myself, and it appears after 6 months nobody else has
reported on it or acknowledged it?
Hi!
In many host configuration files I have an override for EMailAdminUserName.
What happens now is that backuppc's sysadmin mail is sent to the user
specified in EMailAdminUserName of the last host I added.
If you have a look in BackupPC_sendEmail starting from line 181:
foreach my $host ( sort(keys(%Status)) ) {
#
# read any per-PC config settings (allowing per-PC email settings)
#
$bpc->ConfigRead($host);
%Conf = $bpc->Conf();
The problem is that after the loop is done $Conf{EMailAdminUserName} will
contain the username specified as an override in the host configuration
processed last and not the value from the main configuration anymore. But
you use it down in line 386:
if ( $adminMesg ne "" && $Conf{EMailAdminUserName} ne "" ) {
my $headers = $Conf{EMailHeaders};
$headers .= "\n" if ( $headers !~ /\n$/ );
$adminMesg = <<EOF;
To: $Conf{EMailAdminUserName}
Subject: BackupPC administrative attention needed
$headers
${adminMesg}Regards,
PC Backup Genie
EOF
SendMail($adminMesg);
}
I inserted a line to read the main configuration again after the loop (see
attached patch). Is that the way to do it?
Best,
Stefan
Mark Moorcroft
AMA Corp.
mailto:[email protected]
------------------------------------------------------------------------------
_______________________________________________
BackupPC-users mailing list
[email protected]
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/