mirror of
https://github.com/webmin/webmin.git
synced 2025-07-20 16:48:46 +00:00
Add warning if Virtualmin manages the procmail config
This commit is contained in:
@ -39,6 +39,12 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
# Check if config is from Virtualmin
|
||||
@conf = &get_procmailrc();
|
||||
if (&check_virtualmin_config(\@conf)) {
|
||||
print "<b>",$text{'index_virtualmin'},"</b><p>\n";
|
||||
}
|
||||
|
||||
# Build links for adding things
|
||||
@links = ( &ui_link("edit_recipe.cgi?new=1",$text{'index_add'}),
|
||||
&ui_link("edit_recipe.cgi?new=1&block=1",$text{'index_badd'}),
|
||||
@ -46,7 +52,6 @@ else {
|
||||
push(@links, &ui_link("edit_inc.cgi?new=1",$text{'index_iadd'}))
|
||||
if (!$includes);
|
||||
|
||||
@conf = &get_procmailrc();
|
||||
if (@conf) {
|
||||
@tds = ( "width=5" );
|
||||
print &ui_form_start("delete_recipes.cgi", "post");
|
||||
|
@ -2,6 +2,7 @@ index_title=Procmail Mail Filter
|
||||
index_procmail=Procmail mail filter
|
||||
index_desc_other=The procmail actions below from $1 will apply to <b>all</b> email delivered to users on your system. However, they will only be used if Procmail is installed and your mail server is configured to use it.
|
||||
index_mserr=Warning - any rules defined below will not be used : $1
|
||||
index_virtualmin=Warning - your system's procmail configuration was created by Virtualmin to allow per-domain spam and virus filtering. Changing it here may interfere with Virtualmin's functionality.
|
||||
index_action=Action to take
|
||||
index_conds=Conditions
|
||||
index_move=Move
|
||||
|
@ -365,6 +365,23 @@ elsif ($ms eq "sendmail") {
|
||||
return ($ms, $err);
|
||||
}
|
||||
|
||||
# check_virtualmin_config(&config)
|
||||
# Returns 1 if Virtualmin created this procmail config
|
||||
sub check_virtualmin_config
|
||||
{
|
||||
my ($conf) = @_;
|
||||
return 0 if (!&foreign_check("virtual-server"));
|
||||
&foreign_require("virtual-server");
|
||||
my $gotvirt = 0;
|
||||
foreach my $r (@$conf) {
|
||||
if ($r->{'type'} eq '=' &&
|
||||
$r->{'action'} =~ /^VIRTUALMIN=/) {
|
||||
$gotvirt++;
|
||||
}
|
||||
}
|
||||
return $gotvirt;
|
||||
}
|
||||
|
||||
@known_flags = ('H', 'B', 'D', 'h', 'b', 'c', 'w', 'W', 'i', 'r', 'f');
|
||||
|
||||
1;
|
||||
|
Reference in New Issue
Block a user