Forum Moderators: coopster & phranque

Message Too Old, No Replies

Code error for closing sendmail

         

Marcia

4:35 am on May 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm getting this error when trying the revised formmail from sourceforge:

An error has occurred in the program

close mailprog: $?=-1,$!=Broken pipe at form-mail.pl line 507.

This is the section in the code:

}

print MAIL "$dashes\n\n";

foreach (@{$Config{env_report}}) {
print MAIL "$_: ", strip_nonprintable($ENV{$_}), "\n" if $ENV{$_};
}

close (MAIL) ¦¦ die "close mailprog: \$?=$?,\$!=$!";
}

sub open_sendmail_pipe {
my ($fh, $mailprog) = @_;

my $result;
eval { local $SIG{__DIE__};
$result = open $fh, "¦ $mailprog"
};

How do I fix that?

bobriggs

5:04 am on May 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



is the path set correctly for $mailprog?

And what is the return value of that sub? Is it being tested? The message looks like it could indicate that an attempt was made to close a non-open handle. I'd have to see more code.

[added]
I know you can omit the semi-colon in the last if block. Not sure if you can get away with it on that last statement. In fact, the semi-colon after the bracket looks misplaced.

gellyfish

1:05 pm on Jul 21, 2002 (gmt 0)



This is almost certainly because the path you have set in $mailprog is incorrect. If you are still having a problem please could you mail the NMS support list at nms-cgi-support@lists.sourceforge.net with the configuration section from the installed program and an indication of the operating system that you are running this on.

/J\