$EDITOR = $ENV{EDITOR} || $ENV{VISUAL} ||
(-x '/usr/bin/editor' ? '/usr/bin/editor' : 'vi');
-$opt_c = $opt_v = $opt_l = $opt_L = $opt_h = $opt_w = $opt_u = $opt_R = 0;
+$opt_c = $opt_v = $opt_l = $opt_L = $opt_h = $opt_w = $opt_u = 0;
$opt_M = $opt_E = 0;
$opt_r = $opt_d = $opt_q = $opt_a = $opt_n = $opt_k = $opt_m = '';
-$opt_y = $opt_S = $opt_C = $opt_D = $opt_A = $opt_V = $opt_P = '';
+$opt_y = $opt_S = $opt_C = $opt_D = $opt_A = $opt_V = $opt_P = $opt_R = '';
${'opt_/'} = '';
@__ = @ARGV;
warn "WARNING: \$spooldir differs from $FEXHOME/spool !\n";
}
-getopts('hcvlLwuMRE/q:r:d:a:n:k:m:y:S:C:A:V:D:P:') or usage(2);
+getopts('hcvlLwuME/q:r:d:a:n:k:m:y:S:C:A:V:D:P:R:') or usage(2);
usage(0) if $opt_h;
examples() if $opt_E;
# set user restriction file
if ($opt_R) {
- $user = shift or die "usage: $0 -R user\n";
- $user .= '@'.$mdomain if $mdomain and $user !~ /@/;
- die "$0: no user $user\n" unless -d "$spooldir/$user";
- unless (@local_rdomains) {
- die "$0: no \@local_rdomains in server config\n";
- }
- my $rf = "$spooldir/$user/\@ALLOWED_RECIPIENTS";
- open $rf,'>',$rf or die "$0: cannot open $rf - $!";
- print {$rf} "\@LOCAL_RDOMAINS\n";
- close $rf;
- print "$user restricted\n";
+ if ($opt_R eq 'i') {
+ $user = shift or die "usage: $0 -Ri user\n";
+ $user .= '@'.$mdomain if $mdomain and $user !~ /@/;
+ die "$0: no user $user\n" unless -d "$spooldir/$user";
+ unless (@local_rdomains) {
+ die "$0: no \@local_rdomains in server config\n";
+ }
+ my $rf = "$spooldir/$user/\@ALLOWED_RECIPIENTS";
+ open $rf,'>',$rf or die "$0: cannot open $rf - $!";
+ print {$rf} "\@LOCAL_RDOMAINS\n";
+ close $rf;
+ print "$user restricted to internal recipients\n";
+ exit;
+ } elsif ($opt_R eq 'l') {
+ $user = shift or die "usage: $0 -Rl user\n";
+ $user .= '@'.$mdomain if $mdomain and $user !~ /@/;
+ die "$0: no user $user\n" unless -d "$spooldir/$user";
+ my $rf = "$spooldir/$user/\@ALLOWED_RECIPIENTS";
+ open $rf,'>',$rf or die "$0: cannot open $rf - $!";
+ print {$rf} "\@LOCAL_USERS\n";
+ close $rf;
+ print "$user restricted to local recipients\n";
+ exit;
+ } else {
+ usage(2);
+ }
exit;
}
$0 -/ admin auth-ID # set new admin and auth-ID
$0 -q user s:quota # set new disk quota (MB) for sender user
$0 -q user r:quota # set new disk quota (MB) for recipient user
-$0 -R user # restrict user: only internal recipients allowed
+$0 -Ri user # restrict user: only internal domain recipients allowed
+$0 -Rl user # restrict user: only local users as recipients allowed
$0 -rr user # edit user recipients restriction
$0 -ru user # edit user upload restriction
$0 -rd user # edit user download restriction