i'm afraid that there is wrong something else
No, it was not something else. There are simply two bugs. The first fix was correct to activate the code for mail sending but there was a bug in the command writeCertMAil too. I attached a fixed version.
at first i try to fix it by hand by your suggestions, but nothing changed.... when i click on "write a mail" button i get only white screen (i remember that there was some reports about sending mail in 0.9.1.7), in log files there wasn't any relevant informations and no mail comes
The reason is that the code in writeCertMail crashs. C creates a coredump but scripts silently die.
Michael -- ------------------------------------------------------------------- Michael Bell Email: [EMAIL PROTECTED] ZE Computer- und Medienservice Tel.: +49 (0)30-2093 2482 (Computing Centre) Fax: +49 (0)30-2093 2704 Humboldt-University of Berlin Unter den Linden 6 10099 Berlin Email (private): [EMAIL PROTECTED] Germany http://www.openca.org
## OpenCA - RA Server Command ## (c) 1998-2001 by Massimiliano Pala and OpenCA Group ## ## File Name: writeCertMail ## Brief: write a mail ## Version: $Revision: 1.5 $ ## Description: write a mail preformatted by certsMail.txt ## Parameters: key
sub cmdWriteCertMail {
my $key = $query->param ('key');
configError (gettext ("You must specify a certificate before you can use this
function"))
if (not $key);
my $cert = $db->getItem ( DATATYPE => "CERTIFICATE", KEY => $key);
configError (i18nGettext ("Cannot load certificate (__ERRNO__).", "__ERRNO__",
$db->errno()).
"<br>\n".$db->errval())
if (not $cert);
## load mail
my $mail = $tools->getFile ($query->subVar (getRequired ('basemailfile'),
"__LANGUAGE__", $LANGUAGE));
configError (gettext("Cannot load prepared mail"))
if (not $mail);
## fix mail
$mail = $query->subVar ($mail, '@USER@',
$cert->getParsed()->{DN_HASH}->{CN}[0]);
$mail = $query->subVar ($mail, '@SERIAL@', $cert->getSerial());
my $info_list = undef;
$info_list->{BODY}->[0]->[0] = gettext ("Emailaddress");
$info_list->{BODY}->[0]->[1] = '<input type="text" name="emailaddress"
value="'.
$cert->getParsed()->{EMAILADDRESS}.'">';
$info_list->{BODY}->[1]->[0] = gettext ("Subject");
$info_list->{BODY}->[1]->[1] = '<input type="text" name="subject" value="'.
i18nGettext (
"PKI Information for Certificate
__CERT_SERIAL__",
"__CERT_SERIAL__", $cert->getSerial()
).'">';
$info_list->{BODY}->[2]->[0] = gettext ("Content");
$info_list->{BODY}->[2]->[1] = '<textarea cols="80" rows="20" name="body">';
$info_list->{BODY}->[2]->[1] .= $mail;
$info_list->{BODY}->[2]->[1] .= '</textarea>';
my $cmd_panel = undef;
$cmd_panel->[0] = '<input type="submit" name="Submit" value="'.
gettext ("Send").'">';
my $hidden_list = undef;
$hidden_list->{"cmd"} = "sendMail";
return libSendReply (
"NAME" => gettext ("Write Mail"),
"INFO_LIST" => $info_list,
"HIDDEN_LIST" => $hidden_list,
"CMD_PANEL" => $cmd_panel
);
}
1;
