From a74eb51f77215210b3dcf34e6395a0e1334cb114 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Wed, 13 Dec 2023 21:50:21 +0100 Subject: [PATCH] Extract the dkim public key from the private when empty --- interface/web/mail/mail_domain_edit.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interface/web/mail/mail_domain_edit.php b/interface/web/mail/mail_domain_edit.php index f5697b4f1c..8db7baf5eb 100644 --- a/interface/web/mail/mail_domain_edit.php +++ b/interface/web/mail/mail_domain_edit.php @@ -331,6 +331,11 @@ class page_action extends tform_actions { $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]); } + // Extract the dkim public key if not submitted. + if (!empty($this->dataRecord['dkim_private']) && empty( $this->dataRecord['dkim_public']) ) { + $this->dataRecord['dkim_public'] = openssl_pkey_get_details(openssl_pkey_get_private($this->dataRecord['dkim_private']))['key']; + } + //* server_id must be > 0 if(isset($this->dataRecord["server_id"]) && $this->dataRecord["server_id"] < 1) $app->tform->errorMessage .= $app->lng("server_id_0_error_txt"); -- GitLab