i have discovered an edge case in /usr/libexec/webmin/quota/email.pl
if you look at the group quota code, you will find:
local $to;
if quota user from group, set $to = groupname
if quota user from fixed address, set $to = fixed address
else (quota user from virtualmin), look up the domain owner's contact address/user and if domain is found set $to = contact address
if ($to) send out the quota email to user + CC
do you spot the edge case ? ;)
hint: if lookup mode is set to virtualmin, and the group that has hit its quota is not owned by a domain managed by virtualmin (such as a system group), then $to remains empty, so no warning email is sent out to the CC address either.
this means a system admin will not get group warnings for non-virtualmin-domain groups since the send_quota_mail() code will not run when $to is empty.
a fix would probably involve splitting the CC and regular email code from each other (currently they take place in the same function call to send_quota_mail()), so that it first emails the group owner IF FOUND and then emails the CC address regardless.
maybe even change send_quota_mail() to accept an array of to-addresses and generate individual emails for each recipient; this would allow easy notification-list expansion simply by putting each in the array, like "send email to group/domain owner if one exists, and also send to root and to admin@machine.com" which would generate 3 emails. care would have to be taken to also remove duplicate entries from the array before sending, to avoid dual emails if affected account and admin account are the same.
Comments
Submitted by JamieCameron on Sat, 02/16/2013 - 01:17 Comment #1
Thanks for pointing this out - I will fix this in the next release of webmin.
Submitted by aitte on Sat, 02/16/2013 - 01:56 Comment #2
https://github.com/webmin/webmin/commit/ef72374fe4904f618932ae6ad0704545...
...or you could just set $to = $cc, and $cc = undef. haha, congrats on finding an easier fix than my idea!
Submitted by Issues on Sat, 03/02/2013 - 02:02 Comment #3
Automatically closed -- issue fixed for 2 weeks with no activity.