use vars qw($dbhost $dbname $dbuser $dbpass $dbport
$all_stat $fail_stat $change_stat $green_stat
+ $default_host
);
require "$ENV{BFConfDir}/BuildFarmWeb.pl";
my $me = `id -un`; chomp $me;
+my $host = `hostname`; chomp ($host);
+$host = $default_host unless ($host =~ m/[.]/ || !defined($default_host));
-my $host = `hostname`; chomp $host;
+my $from_addr = "PG Build Farm <$me\@$host>";
+$from_addr =~ tr /\r\n//d;
}
my $msg = new Mail::Send;
- $msg->set('From',"PG Build Farm <$me\@$host>");
+ $msg->set('From',$from_addr);
$addr_sth->execute($animal);
"on $sysbranch->{branch} for $hours hours.";
my $msg = new Mail::Send;
- $msg->set('From',"PG Build Farm <$me\@$host>");
+ $msg->set('From',$from_addr);
$addr_sth->execute($animal);
$all_stat $fail_stat $change_stat $green_stat
$server_time
$min_script_version $min_web_script_version
+ $default_host
);
# force this before we do anything - even load modules
my $mailto = [@$all_stat];
push(@$mailto,@$fail_stat) if $stage ne 'OK';
-my $me = `id -un`; chomp $me;
+my $me = `id -un`; chomp($me);
-my $host = `hostname`; chomp $host;
+my $host = `hostname`; chomp ($host);
+$host = $default_host unless ($host =~ m/[.]/ || !defined($default_host));
+
+my $from_addr = "PG Build Farm <$me\@$host>";
+$from_addr =~ tr /\r\n//d;
my $msg = new Mail::Send;
-$msg->set('From',"PG Build Farm <$me\@$host>");
$msg->to(@$mailto);
$msg->bcc(@$bcc_stat) if (@$bcc_stat);
$msg->subject("PGBuildfarm member $animal Branch $branch $stat_type $stage");
+$msg->set('From',$from_addr);
+{ my $handle; open($handle,">>/tmp/mailobj"); print $handle scalar(localtime),Dumper($msg); close($handle); }
my $fh = $msg->open;
print $fh <<EOMAIL;
$msg = new Mail::Send;
-$msg->set('From',"PG Build Farm <$me\@$host>");
$msg->to(@$mailto);
$msg->bcc(@$bcc_chg) if (@$bcc_chg);
$stat_type .= " failure" if $stage ne 'OK';
$msg->subject("PGBuildfarm member $animal Branch $branch Status $stat_type");
+$msg->set('From',$from_addr);
+{ my $handle; open($handle,">>/tmp/mailobj"); print $handle scalar(localtime),Dumper($msg); close($handle); }
$fh = $msg->open;
print $fh <<EOMAIL;
use Template;
use Captcha::reCAPTCHA;
-use vars qw($dbhost $dbname $dbuser $dbpass $dbport $notifyapp $captcha_pubkey $captcha_privkey $template_dir);
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport $notifyapp $captcha_pubkey $captcha_privkey $template_dir $default_host);
require "$ENV{BFConfDir}/BuildFarmWeb.pl";
my $msg = new Mail::Send;
-my $me = `id -un`;
+my $me = `id -un`; chomp($me);
+my $host = `hostname`; chomp ($host);
+$host = $default_host unless ($host =~ m/[.]/ || !defined($default_host));
-my $host = `hostname`;
+my $from_addr = "PG Build Farm <$me\@$host>";
+$from_addr =~ tr /\r\n//d;
-$msg->set('From',"PG Build Farm <$me\@$host>");
+$msg->set('From',$from_addr);
$msg->to(@$notifyapp);
$msg->subject('New Buildfarm Application');