Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
ISPConfig
ISPConfig 3
Commits
e042d3ea
Unverified
Commit
e042d3ea
authored
Dec 23, 2022
by
Helmo
Browse files
Avoid a warning is the dir does not exist
parent
d53109aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/plugins-available/mail_plugin.inc.php
View file @
e042d3ea
...
...
@@ -429,7 +429,7 @@ class mail_plugin {
$maildir_path_deleted
=
false
;
$old_maildir_path
=
$data
[
'old'
][
'maildir'
];
if
(
$old_maildir_path
!=
$mail_config
[
'homedir_path'
]
&&
strlen
(
$old_maildir_path
)
>
strlen
(
$mail_config
[
'homedir_path'
])
&&
!
stristr
(
$old_maildir_path
,
'//'
)
&&
!
stristr
(
$old_maildir_path
,
'..'
)
&&
!
stristr
(
$old_maildir_path
,
'*'
)
&&
strlen
(
$old_maildir_path
)
>=
10
)
{
if
(
$mail_config
[
'mailbox_soft_delete'
]
==
'y'
)
{
if
(
$mail_config
[
'mailbox_soft_delete'
]
==
'y'
&&
is_dir
(
$old_maildir_path
)
)
{
// Move it, adding a date based suffix. A cronjob should purge or archive.
$thrash_maildir_path
=
$old_maildir_path
.
'-deleted-'
.
date
(
"YmdHis"
);
$app
->
system
->
exec_safe
(
'mv ? ?'
,
$old_maildir_path
,
$thrash_maildir_path
);
...
...
@@ -484,7 +484,7 @@ class mail_plugin {
//* Delete maildomain path
$old_maildomain_path
=
$mail_config
[
'homedir_path'
]
.
'/'
.
$data
[
'old'
][
'domain'
];
if
(
$old_maildomain_path
!=
$mail_config
[
'homedir_path'
]
&&
!
stristr
(
$old_maildomain_path
,
'//'
)
&&
!
stristr
(
$old_maildomain_path
,
'..'
)
&&
!
stristr
(
$old_maildomain_path
,
'*'
)
&&
!
stristr
(
$old_maildomain_path
,
'&'
)
&&
strlen
(
$old_maildomain_path
)
>=
10
&&
!
empty
(
$data
[
'old'
][
'domain'
]))
{
if
(
$mail_config
[
'mailbox_soft_delete'
]
==
'y'
)
{
if
(
$mail_config
[
'mailbox_soft_delete'
]
==
'y'
&&
is_dir
(
$old_maildomain_path
)
)
{
// Move it, adding a date based suffix. A cronjob should purge or archive.
$thrash_maildomain_path
=
$old_maildomain_path
.
'-deleted-'
.
date
(
"YmdHis"
);
$app
->
system
->
exec_safe
(
'mv ? ?'
,
$old_maildomain_path
,
$thrash_maildomain_path
);
...
...
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