Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISPConfig
ISPConfig 3
Commits
9851f94e
Commit
9851f94e
authored
Jul 21, 2009
by
tbrehm
Browse files
Fixed: FS#806 - Mailfilter & Folders names w/ spaces
parent
99d5dc85
Changes
1
Hide whitespace changes
Inline
Side-by-side
interface/web/mail/mail_user_filter_edit.php
View file @
9851f94e
...
...
@@ -113,49 +113,59 @@ class page_action extends tform_actions {
$content
=
''
;
$content
.
=
'### BEGIN FILTER_ID:'
.
$this
->
id
.
"
\n
"
;
if
(
$this
->
dataRecord
[
"active"
]
==
'y'
)
{
if
(
$this
->
dataRecord
[
"action"
]
==
'move'
)
{
$TargetNoQuotes
=
$this
->
dataRecord
[
"target"
];
$TargetQuotes
=
"
\"
$TargetNoQuotes
\"
"
;
$TestChDirNoQuotes
=
'$DEFAULT/.'
.
$TargetNoQuotes
;
$TestChDirQuotes
=
"
\"
$TestChDirNoQuotes
\"
"
;
$MailDirMakeNoQuotes
=
$TargetQuotes
.
' $DEFAULT'
;
$EchoTargetFinal
=
$TargetNoQuotes
;
if
(
$this
->
dataRecord
[
"action"
]
==
'move'
)
{
$content
.
=
"
`test -e "
.
'$DEFAULT/.'
.
$this
->
dataRecord
[
"target"
]
.
"
`
if ( "
.
'$RETURNCODE'
.
" !=
0
)
`test -e "
.
$TestChDirQuotes
.
" && exit 1 || exit 0
`
if ( "
.
'$RETURNCODE'
.
" !=
1
)
{
`maildirmake -f
"
.
$this
->
dataRecord
[
"target"
]
.
' $DEFAULT'
.
"
`
`chmod -R 0700 "
.
'$DEFAULT/'
.
$this
->
dataRecord
[
"target"
]
.
"`
`echo INBOX.
"
.
$this
->
dataRecord
[
"target"
]
.
" >> "
.
'$DEFAULT'
.
"/courierimapsubscribed`
`maildirmake -f
$MailDirMakeNoQuotes
`
`chmod -R 0700 "
.
$TestChDirQuotes
.
"`
`echo
\"
INBOX.
$EchoTargetFinal
\
"
>> "
.
'$DEFAULT'
.
"/courierimapsubscribed`
}
"
;
}
$content
.
=
"if (/^"
.
$this
->
dataRecord
[
"source"
]
.
":"
;
$searchterm
=
preg_quote
(
$this
->
dataRecord
[
"searchterm"
]);
if
(
$this
->
dataRecord
[
"op"
]
==
'contains'
)
{
$content
.
=
".*"
.
$searchterm
.
"/:h)
\n
"
;
}
elseif
(
$this
->
dataRecord
[
"op"
]
==
'is'
)
{
$content
.
=
$searchterm
.
"$/:h)
\n
"
;
}
elseif
(
$this
->
dataRecord
[
"op"
]
==
'begins'
)
{
$content
.
=
$searchterm
.
"/:h)
\n
"
;
}
elseif
(
$this
->
dataRecord
[
"op"
]
==
'ends'
)
{
$content
.
=
".*"
.
$searchterm
.
"$/:h)
\n
"
;
}
$content
.
=
"{\n"
;
$content
.
=
"exception {\n"
;
if
(
$this
->
dataRecord
[
"action"
]
==
'move'
)
{
$content
.
=
'to $DEFAULT/.'
.
$this
->
dataRecord
[
"target"
]
.
"/
\n
"
;
}
else
{
$content
.
=
"to /dev/null
\n
"
;
}
$content
.
=
"}
\n
"
;
$content
.
=
"}
\n
"
;
"
;
}
$content
.
=
"if (/^"
.
$this
->
dataRecord
[
"source"
]
.
":"
;
$searchterm
=
preg_quote
(
$this
->
dataRecord
[
"searchterm"
]);
if
(
$this
->
dataRecord
[
"op"
]
==
'contains'
)
{
$content
.
=
".*"
.
$searchterm
.
"/:h)
\n
"
;
}
elseif
(
$this
->
dataRecord
[
"op"
]
==
'is'
)
{
$content
.
=
$searchterm
.
"$/:h)
\n
"
;
}
elseif
(
$this
->
dataRecord
[
"op"
]
==
'begins'
)
{
$content
.
=
$searchterm
.
"/:h)
\n
"
;
}
elseif
(
$this
->
dataRecord
[
"op"
]
==
'ends'
)
{
$content
.
=
".*"
.
$searchterm
.
"$/:h)
\n
"
;
}
$content
.
=
"{\n"
;
$content
.
=
"exception {\n"
;
if
(
$this
->
dataRecord
[
"action"
]
==
'move'
)
{
$content
.
=
'ID'
.
"
$this->id
"
.
'EndFolder = "$DEFAULT/.'
.
$this
->
dataRecord
[
'target'
]
.
'/"'
.
"
\n
"
;
$content
.
=
"to "
.
'$ID'
.
"
$this->id
"
.
'EndFolder'
.
"
\n
"
;
}
else
{
$content
.
=
"to /dev/null
\n
"
;
}
$content
.
=
"}
\n
"
;
$content
.
=
"}
\n
"
;
//}
$content
.
=
'### END FILTER_ID:'
.
$this
->
id
.
"
\n
"
;
...
...
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