Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ISPConfig 3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Zvonimir
ISPConfig 3
Commits
3f6ee66f
Commit
3f6ee66f
authored
Aug 11, 2014
by
Marius Cramer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'master'
Master See merge request !115
parents
596a6093
d5712ba3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
6 deletions
+20
-6
docs/Remote_API_docs.txt
docs/Remote_API_docs.txt
+1
-1
interface/web/mail/mail_domain_dkim_create.php
interface/web/mail/mail_domain_dkim_create.php
+3
-3
server/plugins-available/mail_plugin_dkim.inc.php
server/plugins-available/mail_plugin_dkim.inc.php
+16
-2
No files found.
docs/Remote_API_docs.txt
View file @
3f6ee66f
The remote API documentation is in the remote_client/API-docs subfolder.
\ No newline at end of file
The remote API documentation is in the remoting_client/API-docs subfolder.
interface/web/mail/mail_domain_dkim_create.php
View file @
3f6ee66f
...
...
@@ -80,7 +80,7 @@ function get_public_key($private_key) {
require_once
(
'../../lib/classes/validate_dkim.inc.php'
);
$validate_dkim
=
new
validate_dkim
();
if
(
$validate_dkim
->
validate_post
(
'private'
,
$private_key
))
{
/* validate the $_POST-value */
exec
(
'echo '
.
escapeshellarg
(
$private_key
)
.
'|openssl rsa -pubout -outform PEM'
,
$pubkey
,
$result
);
exec
(
'echo '
.
escapeshellarg
(
$private_key
)
.
'|openssl rsa -pubout -outform PEM
2> /dev/null
'
,
$pubkey
,
$result
);
$public_key
=
pub_key
(
$pubkey
);
}
else
{
$public_key
=
'invalid key'
;
...
...
@@ -92,8 +92,8 @@ $_POST=getRealPOST();
switch
(
$_POST
[
'action'
])
{
case
'create'
:
/* create DKIM Private-key */
exec
(
'openssl rand -out /usr/local/ispconfig/server/temp/random-data.bin 4096'
,
$output
,
$result
);
exec
(
'openssl genrsa -rand /usr/local/ispconfig/server/temp/random-data.bin 1024'
,
$privkey
,
$result
);
exec
(
'openssl rand -out /usr/local/ispconfig/server/temp/random-data.bin 4096
2> /dev/null
'
,
$output
,
$result
);
exec
(
'openssl genrsa -rand /usr/local/ispconfig/server/temp/random-data.bin 1024
2> /dev/null
'
,
$privkey
,
$result
);
unlink
(
"/usr/local/ispconfig/server/temp/random-data.bin"
);
foreach
(
$privkey
as
$values
)
$private_key
=
$private_key
.
$values
.
"
\n
"
;
break
;
...
...
server/plugins-available/mail_plugin_dkim.inc.php
View file @
3f6ee66f
...
...
@@ -123,7 +123,21 @@ class mail_plugin_dkim {
if
(
!
is_dir
(
$mail_config
[
'dkim_path'
]))
{
$app
->
log
(
'DKIM Path '
.
$mail_config
[
'dkim_path'
]
.
' not found - (re)created.'
,
LOGLEVEL_DEBUG
);
mkdir
(
$mail_config
[
'dkim_path'
],
0750
,
true
);
if
(
$app
->
system
->
is_user
(
'amavis'
))
{
$amavis_user
=
'amavis'
;
}
elseif
(
$app
->
system
->
is_user
(
'vscan'
))
{
$amavis_user
=
'vscan'
;
}
else
{
$amavis_user
=
''
;
}
if
(
!
empty
(
$amavis_user
))
{
mkdir
(
$mail_config
[
'dkim_path'
],
0750
,
true
);
exec
(
'chown '
.
$amavis_user
.
' /var/lib/amavis/dkim'
);
unset
(
$amavis_user
);
}
else
{
mkdir
(
$mail_config
[
'dkim_path'
],
0755
,
true
);
}
}
if
(
!
is_writeable
(
$mail_config
[
'dkim_path'
]))
{
...
...
@@ -173,7 +187,7 @@ class mail_plugin_dkim {
$app
->
log
(
'Saved DKIM Private-key to '
.
$key_file
.
'.private'
,
LOGLEVEL_DEBUG
);
$success
=
true
;
/* now we get the DKIM Public-key */
exec
(
'cat '
.
escapeshellarg
(
$key_file
.
'.private'
)
.
'|openssl rsa -pubout'
,
$pubkey
,
$result
);
exec
(
'cat '
.
escapeshellarg
(
$key_file
.
'.private'
)
.
'|openssl rsa -pubout
2> /dev/null
'
,
$pubkey
,
$result
);
$public_key
=
''
;
foreach
(
$pubkey
as
$values
)
$public_key
=
$public_key
.
$values
.
"
\n
"
;
/* save the DKIM Public-key in dkim-dir */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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