Ahem...well..using your new writeCertMail I could make the emails be sent. My new problem is now, that in the notifications all URLs refer to the CAs web-adress and not the RAs web-adress. What did I do wrong now?? Any hints? Am I supposed to give the CA an own web-adress at all (something bothering me for some time now)??
Regards Michael
Michael Bell wrote:
Petr Bousek wrote:
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
------------------------------------------------------------------------
## 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;
-- accom GmbH & Co. KG Gruener Weg 100 52070 Aachen
Tel: +49 241 918 5228 Fax: +49 241 918 5299
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Openca-Users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/openca-users
