Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilherme Filippo
ISPConfig 3
Commits
16539954
Commit
16539954
authored
Aug 14, 2014
by
Florian Schaal
Browse files
fixed (re)creation of DKIM Path and add some warn-logs
parent
a5ce4329
Changes
1
Show whitespace changes
Inline
Side-by-side
server/plugins-available/mail_plugin_dkim.inc.php
View file @
16539954
...
...
@@ -119,8 +119,12 @@ class mail_plugin_dkim {
}
/* dir for dkim-keys writeable? */
$mail_config
=
$app
->
getconf
->
get_server_config
(
$conf
[
'server_id'
],
'mail'
);
if
(
isset
(
$mail_config
[
'dkim_path'
])
&&
(
!
empty
(
$mail_config
[
'dkim_path'
]))
&&
isset
(
$data
[
'new'
][
'dkim_private'
])
&&
!
empty
(
$data
[
'new'
][
'dkim_private'
]))
{
if
(
isset
(
$mail_config
[
'dkim_path'
])
&&
!
empty
(
$mail_config
[
'dkim_path'
])
&&
isset
(
$data
[
'new'
][
'dkim_private'
])
&&
!
empty
(
$data
[
'new'
][
'dkim_private'
])
&&
$mail_config
[
'dkim_path'
]
!=
'/'
)
{
if
(
!
is_dir
(
$mail_config
[
'dkim_path'
]))
{
$app
->
log
(
'DKIM Path '
.
$mail_config
[
'dkim_path'
]
.
' not found - (re)created.'
,
LOGLEVEL_DEBUG
);
if
(
$app
->
system
->
is_user
(
'amavis'
))
{
...
...
@@ -133,10 +137,12 @@ class mail_plugin_dkim {
}
if
(
!
empty
(
$amavis_user
))
{
mkdir
(
$mail_config
[
'dkim_path'
],
0750
,
true
);
exec
(
'chown '
.
$amavis_user
.
'
/var/lib/amavis/dkim'
);
exec
(
'chown '
.
$amavis_user
.
'
'
.
escapeshellarg
(
$mail_config
[
'dkim_path'
])
);
unset
(
$amavis_user
);
}
else
{
mkdir
(
$mail_config
[
'dkim_path'
],
0755
,
true
);
$app
->
log
(
'No user amavis or vscan found - using root for '
.
$mail_config
[
'dkim_path'
]
,
LOGLEVEL_WARNING
);
}
}
...
...
@@ -194,6 +200,8 @@ class mail_plugin_dkim {
if
(
!
file_put_contents
(
$key_file
.
'.public'
,
$public_key
)
===
false
)
$app
->
log
(
'Saved DKIM Public to '
.
$key_domain
.
'.'
,
LOGLEVEL_DEBUG
);
else
$app
->
log
(
'Unable to save DKIM Public to '
.
$key_domain
.
'.'
,
LOGLEVEL_DEBUG
);
}
else
{
$app
->
log
(
'Unable to save DKIM Privte-key to '
.
$key_file
.
'.private'
,
LOGLEVEL_ERROR
);
}
return
$success
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment