|
|
|
@ -612,20 +612,20 @@ sub sendmail($$$$$$$)
|
|
|
|
|
|
|
|
|
|
my $smtp = IO::Socket::INET->new(PeerAddr => 'localhost:25');
|
|
|
|
|
$/="\n";
|
|
|
|
|
SysLog "SMTP: ".<$smtp>."\n";
|
|
|
|
|
SysLog "SMTP: ".<$smtp>;
|
|
|
|
|
print $smtp "HELO hlin.cacert.org\r\n";
|
|
|
|
|
SysLog "SMTP: ".<$smtp>."\n";
|
|
|
|
|
SysLog "SMTP: ".<$smtp>;
|
|
|
|
|
print $smtp "MAIL FROM: <returns\@cacert.org>\r\n";
|
|
|
|
|
SysLog "MAIL FROM: ".<$smtp>."\n";
|
|
|
|
|
SysLog "MAIL FROM: ".<$smtp>;
|
|
|
|
|
|
|
|
|
|
@bits = split(",", $to);
|
|
|
|
|
foreach my $user (@bits)
|
|
|
|
|
{
|
|
|
|
|
print $smtp "RCPT TO: <".trim($user).">\r\n";
|
|
|
|
|
SysLog "RCPT TO: ".<$smtp>."\n";
|
|
|
|
|
SysLog "RCPT TO: ".<$smtp>;
|
|
|
|
|
}
|
|
|
|
|
print $smtp "DATA\r\n";
|
|
|
|
|
SysLog "DATA: ".<$smtp>."\n";
|
|
|
|
|
SysLog "DATA: ".<$smtp>;
|
|
|
|
|
|
|
|
|
|
print $smtp "X-Mailer: CAcert.org Website\r\n";
|
|
|
|
|
print $smtp "X-OriginatingIP: ".$ENV{"REMOTE_ADDR"}."\r\n";
|
|
|
|
@ -660,9 +660,9 @@ sub sendmail($$$$$$$)
|
|
|
|
|
print $smtp "\r\n";
|
|
|
|
|
# print $smtp chunk_split(encode_base64(recode("html..utf-8", $message)))."\r\n.\r\n";
|
|
|
|
|
print $smtp recode("html..utf-8", $message)."\r\n.\r\n";
|
|
|
|
|
SysLog "ENDOFTEXT: ".<$smtp>."\n";
|
|
|
|
|
SysLog "ENDOFTEXT: ".<$smtp>;
|
|
|
|
|
print $smtp "QUIT\n";
|
|
|
|
|
SysLog "QUIT: ".<$smtp>."\n";
|
|
|
|
|
SysLog "QUIT: ".<$smtp>;
|
|
|
|
|
close($smtp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -672,9 +672,12 @@ sub HandleCerts($$)
|
|
|
|
|
my $org=$_[0]?"org":"";
|
|
|
|
|
my $server=$_[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my $table=$org.($server?"domaincerts":"emailcerts");
|
|
|
|
|
|
|
|
|
|
my $sth = $dbh->prepare("select * from $table where crt_name='' and csr_name!='' ");
|
|
|
|
|
SysLog "HandleCerts $table\n";
|
|
|
|
|
|
|
|
|
|
my $sth = $dbh->prepare("select * from $table where crt_name='' and csr_name!='' and warning<3");
|
|
|
|
|
$sth->execute();
|
|
|
|
|
#$rowdata;
|
|
|
|
|
while ( my $rowdata = $sth->fetchrow_hashref() )
|
|
|
|
@ -785,7 +788,10 @@ sub HandleCerts($$)
|
|
|
|
|
system "$opensslbin x509 -in $crtname.der -inform der -out $crtname";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SysLog "ZERO Length certificate received.\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -824,7 +830,9 @@ sub HandleCerts($$)
|
|
|
|
|
$body .= _("Best regards")."\n"._("CAcert.org Support!")."\n\n";
|
|
|
|
|
sendmail($user{email}, "[CAcert.org] "._("Your certificate"), $body, "support\@cacert.org", "", "", "CAcert Support");
|
|
|
|
|
} else {
|
|
|
|
|
$dbh->do("delete from `$table` where `id`='".$row{'id'}."'");
|
|
|
|
|
|
|
|
|
|
SysLog("Could not find the issued certificate. $crtname ".$row{"id"}."\n");
|
|
|
|
|
$dbh->do("update `$table` set warning=warning+1 where `id`='".$row{'id'}."'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -970,7 +978,8 @@ sub HandleGPG()
|
|
|
|
|
$body .= _("Best regards")."\n"._("CAcert.org Support!")."\n\n";
|
|
|
|
|
sendmail($user{email}, "[CAcert.org] Your GPG/PGP Key", $body, "support\@cacert.org", "", "", "CAcert Support");
|
|
|
|
|
} else {
|
|
|
|
|
$dbh->do("delete from `gpg` where `id`='".$row{'id'}."'");
|
|
|
|
|
SysLog("Could not find the issued gpg key. ".$row{"id"}."\n");
|
|
|
|
|
#$dbh->do("delete from `gpg` where `id`='".$row{'id'}."'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|