Hello. I have precisely zero Perl experience. I was told to follow a set of instructions to make a Bugzilla server work with Windows. It was working until I made the changes necessary for Bugzilla to send e-mail. Normally, it would run on Linux where Sendmail would take care of the MTA stuff. But, all I have is an SMTP server on the same box as Bugzilla.
Anyway, the original file had the following lines...
--------------------------------
open(SENDMAIL, "|/usr/lib/sendmail $sendmailparam -t -i") ||
die "Can't open sendmail";
print SENDMAIL trim($msg) . "\n";
close SENDMAIL;
--------------------------------
The instructions for installing on Windows say to change this section to use Perl's libnet, specifically, the SMTP portion. The replacement code provided looks like this...
--------------------------------
use Net::SMTP;
my $smtp_server = 'server.domain.com';
my $smtp = Net::SMTP->new($smtp_server) ||
die 'Cannot connect to server \'$smtp_server\";
$smtp->mail('admin@domain.com');
$smtp->to($person);
$smtp->data();
$smtp->datasend($msg);
$smtp->dataend();
$smtp->quit;
--------------------------------
Obviously, I have changed the above lines to use our SMTP server's FQDN and to use a valid e-mail address on that server, but I didn't want everyone and their mother knowing the name of our mail server.
This is supposed to make Perl use SMTP instead of Sendmail. After making the changes, I'm supposed to run a checksetup.pl file from the command line to make sure everything's ready to rock. It spits out this error...
--------------------------------
Bareword found where operator expected at Bugzilla/BugMail.pm line 877, near "$smtp->mail('admin"
(Might be a runaway multi-line '' string starting on line 875)
(Missing operator before admin?)
Array found where operator expected at Bugzilla/BugMail.pm line 877, at end of line
Bad name after com' at Bugzilla/BugMail.pm line 877.
Compilation failed in require at globals.pl line 36.
BEGIN failed--compilation aborted at globals.pl line 36.
Compilation failed in require at D:\bugzillafiles\checksetup.pl line 1422.
--------------------------------
I don't know how to debug Perl commands. If someone could help me, I would appreciate it.
Thanks.
Anyway, the original file had the following lines...
--------------------------------
open(SENDMAIL, "|/usr/lib/sendmail $sendmailparam -t -i") ||
die "Can't open sendmail";
print SENDMAIL trim($msg) . "\n";
close SENDMAIL;
--------------------------------
The instructions for installing on Windows say to change this section to use Perl's libnet, specifically, the SMTP portion. The replacement code provided looks like this...
--------------------------------
use Net::SMTP;
my $smtp_server = 'server.domain.com';
my $smtp = Net::SMTP->new($smtp_server) ||
die 'Cannot connect to server \'$smtp_server\";
$smtp->mail('admin@domain.com');
$smtp->to($person);
$smtp->data();
$smtp->datasend($msg);
$smtp->dataend();
$smtp->quit;
--------------------------------
Obviously, I have changed the above lines to use our SMTP server's FQDN and to use a valid e-mail address on that server, but I didn't want everyone and their mother knowing the name of our mail server.
This is supposed to make Perl use SMTP instead of Sendmail. After making the changes, I'm supposed to run a checksetup.pl file from the command line to make sure everything's ready to rock. It spits out this error...
--------------------------------
Bareword found where operator expected at Bugzilla/BugMail.pm line 877, near "$smtp->mail('admin"
(Might be a runaway multi-line '' string starting on line 875)
(Missing operator before admin?)
Array found where operator expected at Bugzilla/BugMail.pm line 877, at end of line
Bad name after com' at Bugzilla/BugMail.pm line 877.
Compilation failed in require at globals.pl line 36.
BEGIN failed--compilation aborted at globals.pl line 36.
Compilation failed in require at D:\bugzillafiles\checksetup.pl line 1422.
--------------------------------
I don't know how to debug Perl commands. If someone could help me, I would appreciate it.
Thanks.