Improve DKIM: auto-generate keypair, descriptive signing table (#1029)

Implements the improvements suggested by @fredkilbourn in #1024, cleaned up for current master.

**Changes:**

1. **Auto-generate RSA 2048 keypair** when creating a new DKIM key. Only
generates on the create form, not on list views or edits.

2. **Descriptive signing table dropdown** shows `domain:selector
(description) [id]` instead of just the numeric ID.

3. **Domain:Selector and Description columns** in the signing table list
view via LEFT JOIN.

4. **Order by domain:selector** instead of raw dkim_id.

**Technical notes:**
- Uses `$this->new` check to avoid key generation overhead on list/edit
views
- Handles MySQL (`CONCAT()`) vs SQLite/PostgreSQL (`||`) string
concatenation
- Uses named arguments for `pacol()` per current conventions

Two separate commits. Credit to @fredkilbourn for the original patch.
This commit is contained in:
Kent Riboe authored and GitHub committed 2026-05-23 14:41:13 +01:00
1 parent 1024befd39
commit 650a91bd05
37 files changed
+119 -8

No files matched your search

+2
View File
@@ -505,6 +505,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -504,6 +504,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -505,6 +505,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -520,6 +520,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -521,6 +521,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -517,6 +517,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -318,6 +318,8 @@ $PALANG['pDkim_field_pkey'] = 'Private Key';
$PALANG['pDkim_field_pub'] = 'Public Key';
$PALANG['pDkim_field_author'] = 'Author';
$PALANG['pDkim_field_dkim_id'] = 'Domain Key';
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector';
$PALANG['pDkim_field_description'] = 'Description';
$PALANG['pDkim_field_selector_desc'] = 'Defines the name of the selector to be used when signing messages';
$PALANG['pDkim_field_domain_desc'] = 'Defines the domain which will use this key for signing';
$PALANG['pDkim_field_pkey_desc'] = 'PEM-formatted private key to be used for signing all messages';
+2
View File
@@ -507,6 +507,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -509,6 +509,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -504,6 +504,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -505,6 +505,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -510,6 +510,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -509,6 +509,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -505,6 +505,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -504,6 +504,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -518,6 +518,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -505,6 +505,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -506,6 +506,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -516,6 +516,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -511,6 +511,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -506,6 +506,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -506,6 +506,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -509,6 +509,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -505,6 +505,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -511,6 +511,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -518,6 +518,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -518,6 +518,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -517,6 +517,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -519,6 +519,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -506,6 +506,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -505,6 +505,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -518,6 +518,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -505,6 +505,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -507,6 +507,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+2
View File
@@ -520,6 +520,8 @@ $PALANG['pUpdate_check_releases'] = 'View releases on GitHub'; # XXX
$PALANG['pUpdate_changelog'] = 'Changelog'; # XXX
$PALANG['pUpdate_fetch_error'] = 'Neither cURL nor allow_url_fopen is available. Cannot check for updates.'; # XXX
$PALANG['pUpdate_network_error'] = 'Could not fetch release information from GitHub. Check that your server can reach api.github.com.'; # XXX
$PALANG['pDkim_field_domain_and_selector'] = 'Domain:Selector'; # XXX
$PALANG['pDkim_field_description'] = 'Description'; # XXX
$PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh
/* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */
?>
+20 -2
View File
@@ -16,6 +16,24 @@ class DkimHandler extends PFAHandler
protected function initStruct()
{
// Auto-generate RSA keypair as defaults for the create form
$default_private_key = '';
$default_public_key = '';
if ($this->new && function_exists('openssl_pkey_new')) {
$key = openssl_pkey_new([
'digest_alg' => 'sha512',
'private_key_bits' => 2048,
'private_key_type' => OPENSSL_KEYTYPE_RSA,
]);
if ($key) {
openssl_pkey_export($key, $default_private_key);
$details = openssl_pkey_get_details($key);
if ($details) {
$default_public_key = $details['key'];
}
}
}
$this->struct = array(
# field name allow display in... type $PALANG label $PALANG description default / options / ...
# editing? form list
@@ -23,8 +41,8 @@ class DkimHandler extends PFAHandler
'description' => self::pacol(1, 1, 1, 'text', 'description' , ''),
'selector' => self::pacol(1, 1, 1, 'text', 'pDkim_field_selector', 'pDkim_field_selector_desc'),
'domain_name' => self::pacol(1, 1, 1, 'enum', 'domain' , 'pDkim_field_domain_desc' , '', $this->allowed_domains),
'private_key' => self::pacol(1, 1, 0, 'txta', 'pDkim_field_pkey' , 'pDkim_field_pkey_desc'),
'public_key' => self::pacol(1, 1, 0, 'txta', 'pDkim_field_pub' , 'pDkim_field_pub_desc'),
'private_key' => self::pacol(1, 1, 0, 'txta', 'pDkim_field_pkey' , 'pDkim_field_pkey_desc' , trim($default_private_key)),
'public_key' => self::pacol(1, 1, 0, 'txta', 'pDkim_field_pub' , 'pDkim_field_pub_desc' , trim($default_public_key)),
);
}
+29 -6
View File
@@ -9,7 +9,7 @@ class DkimsigningHandler extends PFAHandler
{
protected string $db_table = 'dkim_signing';
protected string $id_field = 'id';
protected string $order_by = 'dkim_id, author';
protected string $order_by = '__dkim_domain_selector, author';
protected function initStruct()
{
@@ -31,12 +31,35 @@ class DkimsigningHandler extends PFAHandler
array_keys($mail_handler->result())
);
// Build descriptive labels for the DKIM key dropdown: "domain:selector (description) [id]"
$dkim_options = array_map(
fn($v) => "{$v['domain_name']}:{$v['selector']} ({$v['description']}) [{$v['id']}]",
$dkim_handler->result()
);
// MySQL uses CONCAT(), SQLite and PostgreSQL use || for string concatenation
$dkim_table = table_by_key('dkim');
if (db_mysql()) {
$concat_expr = "CONCAT(domain_name, ':', selector)";
} else {
$concat_expr = "(domain_name || ':' || selector)";
}
$this->struct = array(
# field name allow display in... type $PALANG label $PALANG description default / options / ...
# editing? form list
'id' => self::pacol(0, 0, 1, 'num' , 'pFetchmail_field_id' , '' , '', array(), 0, 1),
'dkim_id' => self::pacol(1, 1, 1, 'enum' , 'pDkim_field_dkim_id' , 'pDkim_field_dkim_id_desc' , '', array_keys($dkim_handler->result)),
'author' => self::pacol(1, 1, 1, 'enum' , 'pDkim_field_author' , 'pDkim_field_author_desc' , '', $authors),
# field name allow display in... type $PALANG label $PALANG description default / options / ...
# edit? form list
'id' => self::pacol(0, 0, 1, 'num', 'pFetchmail_field_id', '', '', array(), 0, 1),
'dkim_id' => self::pacol(1, 1, 1, 'enma', 'pDkim_field_dkim_id', 'pDkim_field_dkim_id_desc', '', $dkim_options),
'__dkim_domain_selector' => self::pacol(0, 0, 1, 'text', 'pDkim_field_domain_and_selector', '',
dont_write_to_db: 1,
extrafrom: 'LEFT JOIN ('
. " SELECT id AS __dkim_id,"
. " $concat_expr AS __dkim_domain_selector,"
. " description AS __dkim_description"
. " FROM $dkim_table"
. ') AS __dkim ON __dkim_id = dkim_id'),
'__dkim_description' => self::pacol(0, 0, 1, 'text', 'pDkim_field_description', '', dont_write_to_db: 1),
'author' => self::pacol(1, 1, 1, 'enum', 'pDkim_field_author', 'pDkim_field_author_desc', '', $authors),
);
}