choose [<genopts>] [<redirect>] [#<comment>] (interactively allocate)
update <addr> [<redirect>] [#<comment>]
show <addr>
- list
+ list [-a] (-a also lists aliases set to reject)
list-actions
empty string for redirect means reject
remember to quote comments (to protect # from your shell)
}
}
-sub action_list {
+sub action_list (;$) {
+ my ($q, $listall);
+ my ($x) = @_;
+ if ( defined $x ) { $listall = 1; }
+ my $v =shift @ARGV;
+ if ( defined $v ) {
+ if ($v ne "-a") {die "only legal argument to list is -a";}
+ else { $listall=1; }
+ }
nomoreargs;
- my $q = $dbh->prepare("SELECT * FROM addrs WHERE user=?".
- " ORDER BY localpart");
+ if($listall){
+ $q = $dbh->prepare("SELECT * FROM addrs WHERE user=?".
+ " ORDER BY localpart");
+ }else{
+ $q = $dbh->prepare("SELECT * FROM addrs WHERE user=?".
+ " AND redirect <>'' ORDER BY localpart");
+ }
$q->execute($user);
listq($q);
}
die unless $priv;
$user = nextarg;
nomoreargs;
- action_list;
+ action_list "-a";
}
sub action_list_all {