mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +03:00
Chaned some error_log() to MailSo Logger()
This commit is contained in:
parent
182f884374
commit
847d33abc6
3 changed files with 8 additions and 5 deletions
|
|
@ -81,7 +81,7 @@ trait Pgp
|
||||||
if (\is_link($link) || \symlink($homedir, $link)) {
|
if (\is_link($link) || \symlink($homedir, $link)) {
|
||||||
$homedir = $link;
|
$homedir = $link;
|
||||||
} else {
|
} else {
|
||||||
\error_log("symlink('{$homedir}', '{$link}') failed");
|
$this->logWrite("symlink('{$homedir}', '{$link}') failed", \LOG_WARNING, 'GnuPG');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Else try ~/.gnupg/ + hash(email address)
|
// Else try ~/.gnupg/ + hash(email address)
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ trait SMime
|
||||||
\openssl_pkcs7_read(
|
\openssl_pkcs7_read(
|
||||||
"-----BEGIN PKCS7-----\n\n{$sBody}\n-----END PKCS7-----",
|
"-----BEGIN PKCS7-----\n\n{$sBody}\n-----END PKCS7-----",
|
||||||
$certificates
|
$certificates
|
||||||
) || \error_log("OpenSSL openssl_pkcs7_read: " . \openssl_error_string());
|
) || $this->logWrite("openssl_pkcs7_read: " . \openssl_error_string(), \LOG_ERR, 'OpenSSL');
|
||||||
foreach ($certificates as $certificate) {
|
foreach ($certificates as $certificate) {
|
||||||
$this->SMIME()->storeCertificate($certificate);
|
$this->SMIME()->storeCertificate($certificate);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,15 @@ class OpenSSL
|
||||||
{
|
{
|
||||||
$data = \openssl_x509_parse(\openssl_x509_read($certificate));
|
$data = \openssl_x509_parse(\openssl_x509_read($certificate));
|
||||||
if (!$data) {
|
if (!$data) {
|
||||||
\error_log("OpenSSL parse: " . \openssl_error_string());
|
\SnappyMail\Log::error('OpenSSL', "parse: " . \openssl_error_string());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$key = \str_replace(':', '', $data['extensions']['subjectKeyIdentifier'] ?? $data['hash']);
|
$key = \str_replace(':', '', $data['extensions']['subjectKeyIdentifier'] ?? $data['hash']);
|
||||||
$filename = "{$this->homedir}/{$key}.crt";
|
$filename = "{$this->homedir}/{$key}.crt";
|
||||||
if (!\file_exists($filename)) {
|
if (\file_exists($filename)) {
|
||||||
|
\SnappyMail\Log::debug('OpenSSL', 'certificate already imported');
|
||||||
|
} else {
|
||||||
|
\SnappyMail\Log::debug('OpenSSL', 'certificate imported');
|
||||||
\file_put_contents("{$this->homedir}/{$key}.crt", $certificate);
|
\file_put_contents("{$this->homedir}/{$key}.crt", $certificate);
|
||||||
// \unlink("{$this->homedir}/certificates.json");
|
// \unlink("{$this->homedir}/certificates.json");
|
||||||
$this->certificates(true);
|
$this->certificates(true);
|
||||||
|
|
@ -98,7 +101,7 @@ class OpenSSL
|
||||||
}
|
}
|
||||||
$result[] = $short;
|
$result[] = $short;
|
||||||
} else {
|
} else {
|
||||||
\error_log("OpenSSL parse({$file}): " . \openssl_error_string());
|
\SnappyMail\Log::error('OpenSSL', "parse({$file}): " . \openssl_error_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
\file_put_contents($cacheFile, \json_encode($result));
|
\file_put_contents($cacheFile, \json_encode($result));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue