From c3985b574a4e5bc25a0b6a7a8922027850a9a6b9 Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Wed, 30 Jul 2003 14:42:55 +0000 Subject: [PATCH] Now it emails me instead of failing to write to a file git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2121 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd-web/src/webpmd.pl | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pmd-web/src/webpmd.pl b/pmd-web/src/webpmd.pl index 743915e6bc..54614fd3ca 100644 --- a/pmd-web/src/webpmd.pl +++ b/pmd-web/src/webpmd.pl @@ -100,12 +100,21 @@ sub loadProjectList() { } sub addProject() { - my ($project) = @_; - my $cmd = "echo \"@{[$project->getString()]}\" > @{[$project->getJobsFile()]}"; - eval { - # for some reason this succeeds, but the CGI script fails. Very odd. - `${cmd}`; - } + my ($project) = @_; + #my $cmd = "echo \"@{[$project->getString()]}\" > @{[$project->getJobsFile()]}"; + #my $cmd = "mail tomcopeland@users.sourceforge.net -s \"@{[$project->getString()]}\""; + #system("${cmd}"); + open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq") or die "Couldn't send email: $!\n"; + print SENDMAIL <<"EOF"; +From: PMD-WEB +To: Tom Copeland +Subject: @{[$project->getString()]} + +enter it + +EOF + + close(SENDMAIL) or warn "Sendmail didn't close nicely"; } $page=param("state") || "default";