Allow cc'ing of email to groups who are over quota to another address

This commit is contained in:
Jamie Cameron
2008-10-12 19:52:09 +00:00
parent 1cedb55cd2
commit 1325fdf41e
4 changed files with 10 additions and 3 deletions

View File

@@ -33,4 +33,4 @@ Quotas are considered active for a filesystem if the usrquota or grpquota option
---- Changes since 1.400 ----
If a user to email is a Virtualmin domain owner, send email to the domain's contact address.
---- Changes since 1.430 ----
Email to users who are over quota on some filesystem can also be Cc'd to another address, such as the system administrator.
Email to users and groups who are over quota on some filesystem can also be Cc'd to another address, such as the system administrator.

View File

@@ -154,9 +154,10 @@ foreach $k (keys %config) {
$group{$i,'ublocks'},
$f,
$upercent,
$config{'email_from_'.$f},
$config{'gemail_from_'.$f},
$group{$i,'gblocks'},
'gemail',
$config{'gemail_cc_'.$f},
);
}

View File

@@ -266,7 +266,11 @@ if ($access{'email'} && &foreign_check("cron") &&
print &ui_table_row($text{'lusers_from'},
&ui_textbox("from", $config{"gemail_from_$f"} ||
'webmin@'.&get_system_hostname(), 20));
'webmin@'.&get_system_hostname(), 30));
print &ui_table_row($text{'lusers_cc'},
&ui_opt_textbox("cc", $config{"gemail_cc_$f"}, 30,
$text{'lusers_nocc'}), 3);
print &ui_table_end();
print &ui_form_end([ [ 'save', $text{'lusers_apply'} ] ]);

View File

@@ -14,6 +14,7 @@ if ($in{'email'}) {
$in{'from'} =~ /^\S+$/i || &error($text{'email_efrom'});
$in{'tomode'} != 1 || $in{'to'} =~ /^\S+$/ ||
&error($text{'email_eto'});
$in{'cc_def'} || $in{'cc'} =~ /^\S+$/i || &error($text{'email_ecc'});
}
# Save settings
@@ -25,6 +26,7 @@ $config{"gemail_percent_".$in{'filesys'}} = $in{'percent'};
$config{"gemail_from_".$in{'filesys'}} = $in{'from'};
$config{"gemail_to_".$in{'filesys'}} = $in{'to'};
$config{"gemail_tomode_".$in{'filesys'}} = $in{'tomode'};
$config{"gemail_cc_".$in{'filesys'}} = $in{'cc'};
&save_module_config();
&unlock_file($module_config_file);