Allow cc'ing of email to groups who are over quota to another address
authorJamie Cameron <jcameron@webmin.com>
Sun, 12 Oct 2008 19:52:09 +0000 (19:52 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sun, 12 Oct 2008 19:52:09 +0000 (19:52 +0000)
quota/CHANGELOG
quota/email.pl
quota/list_groups.cgi
quota/save_gemail.cgi

index 0a675b1..7718a3a 100644 (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.
index 8a95f7c..8ff6b87 100755 (executable)
@@ -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},
                                        );
                                }
 
index c9d9a92..a840103 100755 (executable)
@@ -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'} ] ]);
index d6e8dcc..49ea985 100755 (executable)
@@ -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);