rolf: die - cannot close email

Beitrag lesen

hallo Siechfred,

Warum sollte im script
print 517;[/code]
stehen?

"517 Syntax error" deutet darauf hin, dass in einem Deiner Mail-Header ein Fehler drin ist. Allerdings kann man anhand Deines Codes nicht sagen, welcher das ist. Teste also zuerst, ob Dein Programm wie erwartet funktioniert, wenn die Headerangaben hardcodiert sind.

hardcodiert? Was bedeutet das?

Dann prüfe, ob diejenigen Header-Felder in Ordnung sind, welche aus %Config kommen. Ich hätte da einen Verdacht, der auf ein Problem hier:

if (!$Config{'email'}) { print MAIL "From: nomail@fun.com\n"; }
else
{ print MAIL "From: $Config{'email'}\n"; }

und das wäre?

hinweist. Überprüfst Du die Formulareingaben auf Validität? Wenn ja, wo und wie?

ja bevor das mailprogram geöffnet wird und zwar so:

sub check_required {

The following insures that there were no newlines in any fields which  #

will be used in the header.

$comm = $Form{'comment'}||'';                                            #
if ($Config{'subject'} =~ /(\n|\r)/m || $Config{'email'} =~ /(\n|\r)/m || $comm =~  /(href|script)/m) {
&error('request_method');
}

For each require field defined in the form:                            #

foreach $require (@Required) {
if ($require eq 'email' && !&check_email($Config{$require}))
{
push(@error,$require);
}

Otherwise, if the required field is a configuration field and it   #

has no value or has been filled in with a space, send an error.    #

elsif (defined($Config{$require})) {
unless ($Config{$require}) {
push(@error,$require);
}
}

If it is a regular form field which has not been filled in or      #

filled in with a space, flag it as an error field.                 #

elsif (!$Form{$require}) {
push(@error,$require);
}
}

If any error fields have been found, send error message to the user.   #

if (@error) { &error('missing_fields', @error) }
}
---------------------------------------
und

sub general {
if (defined($Config{'email'}) && !&check_email($Config{'email'}) && ($Config{'email'} ne '')||!$ENV{'HTTP_USER_AGENT'}||!$Config{'subject'})
{
print "Content-type: text/html\n\n";
print "fatal error: you have a bad email or the form was not successful,from where you submit it\n";
exit;
}
}
---------------------------------------
und
sub check_email {

Initialize local email variable with input to subroutine.              #

$email = $_[0];

if ($email =~ /(@.*@)|(/)|(,)|(%)|(<)|(..)|(@.)|(.@)|(^.)/ ||

the e-mail address contains an invalid syntax.  Or, if the         #

syntax does not match the following regular expression pattern     #

it fails basic syntax verification.                                #

$email !~ /^.+@([?)[a-zA-Z0-9-.]+.([a-zA-Z0-9]+)(]?)$/) {

return 0;
}

else {

Return a true value, e-mail verification passed.                   #

return 1;
}
}

Der "broken pipe"-Fehler ist m.E. ein Folgefehler.

MfG
rolf