Use virtualmin email address if possible
authorJamie Cameron <jcameron@webmin.com>
Fri, 21 Mar 2008 21:58:23 +0000 (21:58 +0000)
committerJamie Cameron <jcameron@webmin.com>
Fri, 21 Mar 2008 21:58:23 +0000 (21:58 +0000)
quota/CHANGELOG
quota/email.pl

index 4f075ed..acd63cd 100644 (file)
@@ -30,3 +30,5 @@ Added a Module Config option to sort user lists by the percentage of soft quota
 Added a Module Config option to show both hard and/or soft quota percentages.
 ---- Changes since 1.380 ----
 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.
index 88e3f44..0a08c3c 100755 (executable)
@@ -56,7 +56,12 @@ foreach $k (keys %config) {
                                if ($d) {
                                        local @users = &virtual_server::list_domain_users($d, 0, 0, 1, 1);
                                        local ($uinfo) = grep { $_->{'user'} eq $user{$i,'user'} } @users;
-                                       if ($uinfo && $uinfo->{'email'}) {
+                                       if ($uinfo && $uinfo->{'domainowner'}) {
+                                               # Domain owner, with own email
+                                               $email = $d->{'emailto'};
+                                               }
+                                       elsif ($uinfo && $uinfo->{'email'}) {
+                                               # Regular user with email
                                                $email = $uinfo->{'email'};
                                                }
                                        }