Quotas are considered active for a filesystem if the usrquota or grpquota options are on in /etc/mtab, even if missing from /etc/fstab.
---- 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.
$config{'email_from_'.$f},
$user{$i,'gblocks'},
'email',
+ $config{'email_cc_'.$f},
);
# Save last email time
sub send_quota_mail
{
-local ($user, $addr, $limit, $used, $fs, $percent, $from, $grace, $suffix) =@_;
+local ($user, $addr, $limit, $used, $fs, $percent, $from, $grace, $suffix,
+ $ccaddr) = @_;
local $bsize = &block_size($fs);
if ($bsize) {
$used = &nice_size($used*$bsize);
}
&mailboxes::send_text_mail($from || &mailboxes::get_from_address(),
$addr,
- undef,
+ $ccaddr,
$subject,
$body);
}
luser_virtualmin=Get domain from Virtualmin?
lusers_from=From: address for email
lusers_mass=Update Selected Users
+lusers_cc=Also Cc: email to
+lusers_nocc=Don't Cc
grace_seconds=Seconds
grace_minutes=Minutes
email_epercent=Missing or invalid usage percentage
email_edomain=Missing or invalid mail domain
email_efrom=Missing or invalid From: address
+email_ecc=Missing or invalid Cc: address
email_msg=Disk usage for user $1 on filesystem $2 has reached $3% of the\nallowed quota.\n\n$4 of disk space is being used, out of a maximum of $5.
gemail_msg=Disk usage for group $1 on filesystem $2 has reached $3% of the\nallowed quota.\n\n$4 of disk space is being used, out of a maximum of $5.
email_subject=Disk quota exceeded
print &ui_table_row($text{'lusers_from'},
&ui_textbox("from", $config{"email_from_$f"} ||
- 'webmin@'.&get_system_hostname(), 20));
+ 'webmin@'.&get_system_hostname(), 30));
+
+ print &ui_table_row($text{'lusers_cc'},
+ &ui_opt_textbox("cc", $config{"email_cc_$f"}, 30,
+ $text{'lusers_nocc'}), 3);
print &ui_table_end();
print &ui_form_end([ [ 'save', $text{'lusers_apply'} ] ]);
$in{'percent'} =~ /^[0-9\.]+$/ || &error($text{'email_epercent'});
$in{'domain'} =~ /^[a-z0-9\.\-]+$/i || &error($text{'email_edomain'});
$in{'from'} =~ /^\S+$/i || &error($text{'email_efrom'});
+ $in{'cc_def'} || $in{'cc'} =~ /^\S+$/i || &error($text{'email_ecc'});
}
# Save settings
$config{"email_domain_".$in{'filesys'}} = $in{'domain'};
$config{"email_virtualmin_".$in{'filesys'}} = $in{'virtualmin'};
$config{"email_from_".$in{'filesys'}} = $in{'from'};
+$config{"email_cc_".$in{'filesys'}} = $in{'cc'};
&save_module_config();
&unlock_file($module_config_file);