From 4687bff96de300d50e5504256c4be3bd66a831d0 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Mon, 13 May 2019 18:28:44 -0400 Subject: [PATCH] Bump default DKIM key length to 2048 This matches the Debian default for opendkim-genkey Refs #337 --- bureau/class/m_mail.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bureau/class/m_mail.php b/bureau/class/m_mail.php index 18a5934e..cf2af8f9 100644 --- a/bureau/class/m_mail.php +++ b/bureau/class/m_mail.php @@ -1182,10 +1182,12 @@ ORDER BY if (!file_exists($target_dir.'/alternc.txt')) { $this->shouldreloaddkim=true; if (! is_dir($target_dir)) mkdir($target_dir); // create dir - // Generate the key, 1200 bits (better than 1024) $old_dir=getcwd(); chdir($target_dir); - exec('opendkim-genkey -b 1200 -r -d '.escapeshellarg($domain).' -s "alternc" '); + // Generate the key, 2048 bits (better than 1024) + // 2048 bits is also the default in recent Debian builds of opendkim + // @see man opendkim-genkey + exec('opendkim-genkey -b 2048 -r -d '.escapeshellarg($domain).' -s "alternc" '); chdir($old_dir); // opendkim must be owner of the key chown("$target_dir/alternc.private", 'opendkim');