X-Git-Url: https://git.exim.org/buildfarm-server.git/blobdiff_plain/d8818469c070065e44415ede75007d5f3b276ea3..9aab6bac9c2c174a5ef8869e9b947a3917e18087:/cgi-bin/register.pl diff --git a/cgi-bin/register.pl b/cgi-bin/register.pl index b15a0e2..5b1ce0a 100755 --- a/cgi-bin/register.pl +++ b/cgi-bin/register.pl @@ -1,5 +1,13 @@ #!/usr/bin/perl +=comment + +Copyright (c) 2003-2010, Andrew Dunstan + +See accompanying License file for license details + +=cut + use strict; use DBI; use Template; @@ -7,7 +15,7 @@ use CGI; 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"; @@ -123,11 +131,14 @@ use Mail::Send; 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');