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
Issues
493
Issues
493
List
Boards
Labels
Service Desk
Milestones
Merge Requests
32
Merge Requests
32
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISPConfig
ISPConfig 3
Commits
b6108193
Commit
b6108193
authored
Oct 28, 2009
by
tbrehm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added: FS#873 - Option to redirect spam into a .Junk directory
parent
4a542659
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
3 deletions
+43
-3
install/sql/ispconfig3.sql
install/sql/ispconfig3.sql
+1
-0
interface/web/mail/form/mail_user.tform.php
interface/web/mail/form/mail_user.tform.php
+6
-1
interface/web/mail/lib/lang/en_mail_user.lng
interface/web/mail/lib/lang/en_mail_user.lng
+1
-0
interface/web/mail/templates/mail_user_mailfilter_edit.htm
interface/web/mail/templates/mail_user_mailfilter_edit.htm
+6
-0
server/conf/mailfilter_move_junk.master
server/conf/mailfilter_move_junk.master
+19
-0
server/plugins-available/maildrop_plugin.inc.php
server/plugins-available/maildrop_plugin.inc.php
+10
-2
No files found.
install/sql/ispconfig3.sql
View file @
b6108193
...
...
@@ -522,6 +522,7 @@ CREATE TABLE `mail_user` (
`homedir`
varchar
(
255
)
NOT
NULL
,
`autoresponder`
enum
(
'n'
,
'y'
)
NOT
NULL
default
'n'
,
`autoresponder_text`
mediumtext
NULL
,
`move_junk`
enum
(
'n'
,
'y'
)
NOT
NULL
default
'n'
,
`custom_mailfilter`
mediumtext
,
`postfix`
enum
(
'n'
,
'y'
)
NOT
NULL
,
`access`
enum
(
'n'
,
'y'
)
NOT
NULL
,
...
...
interface/web/mail/form/mail_user.tform.php
View file @
b6108193
...
...
@@ -202,7 +202,12 @@ $form["tabs"]['filter_records'] = array (
##################################
# Begin Datatable fields
##################################
'move_junk'
=>
array
(
'datatype'
=>
'VARCHAR'
,
'formtype'
=>
'CHECKBOX'
,
'default'
=>
'n'
,
'value'
=>
array
(
0
=>
'n'
,
1
=>
'y'
)
),
##################################
# ENDE Datatable fields
##################################
...
...
interface/web/mail/lib/lang/en_mail_user.lng
View file @
b6108193
...
...
@@ -29,4 +29,5 @@ $wb["disableimap_txt"] = 'Disable IMAP';
$wb
[
"disablepop3_txt"
]
=
'Disable POP3'
;
$wb
[
"duplicate_alias_or_forward_txt"
]
=
'There is already an alias or forwrd with this email address.'
;
$wb
[
"quota_error_value"
]
=
'Invalid quota value. Allowed values are: 0 for unlimited or numbers > 1'
;
$wb
[
"move_junk_txt"
]
=
'Move Spam Emails to Junk directory'
;
?>
interface/web/mail/templates/mail_user_mailfilter_edit.htm
View file @
b6108193
...
...
@@ -5,6 +5,12 @@
<div
class=
"pnl_formsarea"
>
<fieldset
class=
"inlineLabels"
>
<div
class=
"ctrlHolder"
>
<p
class=
"label"
>
{tmpl_var name='move_junk_txt'}
</p>
<div
class=
"multiField"
>
{tmpl_var name='move_junk'}
</div>
</div>
</fieldset>
{tmpl_var name='filter_records'}
...
...
server/conf/mailfilter_move_junk.master
0 → 100644
View file @
b6108193
SPAMDIR="Junk"
SPAMDIRFULL="$DEFAULT/.Junk"
if ( /^X-Spam-Flag: YES$/ )
{
exception {
`test -e $SPAMDIRFULL`
if ( $RETURNCODE != 0 )
{
`maildirmake -f $SPAMDIR $DEFAULT`
`chown vmail:vmail -R $SPAMDIRFULL`
`chmod 0700 $SPAMDIRFULL`
`echo INBOX.$SPAMDIR >> $DEFAULT/courierimapsubscribed`
}
to "$SPAMDIRFULL/"
}
}
\ No newline at end of file
server/plugins-available/maildrop_plugin.inc.php
View file @
b6108193
...
...
@@ -155,7 +155,8 @@ class maildrop_plugin {
}
// Write the custom mailfilter script, if mailfilter recipe has changed
if
(
$data
[
"old"
][
"custom_mailfilter"
]
!=
$data
[
"new"
][
"custom_mailfilter"
])
{
if
(
$data
[
"old"
][
"custom_mailfilter"
]
!=
$data
[
"new"
][
"custom_mailfilter"
]
or
$data
[
"old"
][
"move_junk"
]
!=
$data
[
"new"
][
"move_junk"
])
{
$app
->
log
(
"Mailfilter config has been changed"
,
LOGLEVEL_DEBUG
);
if
(
trim
(
$data
[
"new"
][
"custom_mailfilter"
])
!=
''
)
{
// Delete the old filter recipe
...
...
@@ -170,7 +171,14 @@ class maildrop_plugin {
$email_parts
=
explode
(
"@"
,
$data
[
"old"
][
"email"
]);
}
$config_file_path
=
$this
->
mailfilter_config_dir
.
'/'
.
$email_parts
[
1
]
.
'/'
.
$email_parts
[
0
]
.
'/.mailfilter'
;
file_put_contents
(
$config_file_path
,
$data
[
"new"
][
"custom_mailfilter"
]);
$mailfilter_content
=
''
;
if
(
$data
[
"new"
][
"move_junk"
]
==
'y'
)
{
$mailfilter_content
.
=
file_get_contents
(
$conf
[
"rootpath"
]
.
'/conf/mailfilter_move_junk.master'
)
.
"
\n
"
;
}
$mailfilter_content
.
=
$data
[
"new"
][
"custom_mailfilter"
];
file_put_contents
(
$config_file_path
,
$mailfilter_content
);
$app
->
log
(
"Writing new custom Mailfiter"
.
$config_file_path
,
LOGLEVEL_DEBUG
);
exec
(
"chmod 770
$config_file_path
"
);
exec
(
"chown vmail
$config_file_path
"
);
...
...
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