- added Domainkey-Filter configuration for FreeBSD (thx to hedo)
- bugfixed DKIM verification failure when using .private file-extension (also thx to hedo), fixes #63
This commit is contained in:
@@ -111,6 +111,21 @@ return Array(
|
|||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'sh /usr/local/etc/rc.d/postfix restart'
|
'sh /usr/local/etc/rc.d/postfix restart'
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
'dkim' => Array(
|
||||||
|
'label' => 'DomainKey filter',
|
||||||
|
'commands' => Array(
|
||||||
|
'cd /usr/ports/mail/dkim-milter/',
|
||||||
|
'make install clean',
|
||||||
|
'touch /usr/local/etc/mail/dkim-filter.conf'
|
||||||
|
),
|
||||||
|
'files' => Array(
|
||||||
|
'dkim-filter.conf' => '/usr/local/etc/mail/dkim-filter.conf',
|
||||||
|
'postfix_dkim_addition.cf' => '/usr/local/etc/postfix/main.cf'
|
||||||
|
),
|
||||||
|
'restart' => Array(
|
||||||
|
'/usr/local/etc/rc.d/milter-dkim restart '
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ class bind
|
|||||||
|
|
||||||
while($domain = $this->db->fetch_array($result_domains))
|
while($domain = $this->db->fetch_array($result_domains))
|
||||||
{
|
{
|
||||||
$privkey_filename = makeCorrectFile($this->settings['dkim']['dkim_prefix'] . '/dkim_' . $domain['dkim_id'] . '.private');
|
$privkey_filename = makeCorrectFile($this->settings['dkim']['dkim_prefix'] . '/dkim_' . $domain['dkim_id']);
|
||||||
$pubkey_filename = makeCorrectFile($this->settings['dkim']['dkim_prefix'] . '/dkim_' . $domain['dkim_id'] . '.public');
|
$pubkey_filename = makeCorrectFile($this->settings['dkim']['dkim_prefix'] . '/dkim_' . $domain['dkim_id'] . '.public');
|
||||||
|
|
||||||
if($domain['dkim_privkey'] == ''
|
if($domain['dkim_privkey'] == ''
|
||||||
@@ -297,7 +297,7 @@ class bind
|
|||||||
{
|
{
|
||||||
$max_dkim_id = $this->db->query_first("SELECT MAX(`dkim_id`) as `max_dkim_id` FROM `" . TABLE_PANEL_DOMAINS . "`");
|
$max_dkim_id = $this->db->query_first("SELECT MAX(`dkim_id`) as `max_dkim_id` FROM `" . TABLE_PANEL_DOMAINS . "`");
|
||||||
$domain['dkim_id'] = (int)$max_dkim_id['max_dkim_id'] + 1;
|
$domain['dkim_id'] = (int)$max_dkim_id['max_dkim_id'] + 1;
|
||||||
$privkey_filename = makeCorrectFile($this->settings['dkim']['dkim_prefix'] . '/dkim_' . $domain['dkim_id'] . '.private');
|
$privkey_filename = makeCorrectFile($this->settings['dkim']['dkim_prefix'] . '/dkim_' . $domain['dkim_id']);
|
||||||
safe_exec('openssl genrsa -out ' . escapeshellarg($privkey_filename) . ' 1024');
|
safe_exec('openssl genrsa -out ' . escapeshellarg($privkey_filename) . ' 1024');
|
||||||
$domain['dkim_privkey'] = file_get_contents($privkey_filename);
|
$domain['dkim_privkey'] = file_get_contents($privkey_filename);
|
||||||
safe_exec("chmod 0640 " . escapeshellarg($privkey_filename));
|
safe_exec("chmod 0640 " . escapeshellarg($privkey_filename));
|
||||||
|
|||||||
15
templates/misc/configfiles/freebsd/dkim/dkim-filter.conf
Normal file
15
templates/misc/configfiles/freebsd/dkim/dkim-filter.conf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
Syslog yes
|
||||||
|
UMask 002
|
||||||
|
|
||||||
|
Canonicalization relaxed/simple
|
||||||
|
Mode sv
|
||||||
|
SubDomains yes
|
||||||
|
X-Header yes
|
||||||
|
|
||||||
|
KeyList /usr/local/etc/mail/dkim.key
|
||||||
|
Domain /usr/local/etc/mail/domains
|
||||||
|
LogWhy yes
|
||||||
|
|
||||||
|
Socket inet:8891@localhost
|
||||||
|
|
||||||
|
# OmitHeaders Return-Path,Received,Comments,Keywords,Bcc,Resent-Bcc,To
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#
|
||||||
|
# Add these lines to the main.cf to use DKIM
|
||||||
|
#
|
||||||
|
milter_default_action = accept
|
||||||
|
milter_protocol = 2
|
||||||
|
smtpd_milters = inet:localhost:8891
|
||||||
|
non_smtpd_milters = inet:localhost:8891
|
||||||
Reference in New Issue
Block a user