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 {
+ my $listall = 0;
+ $listall ||= $priv;
+ while (@ARGV) {
+ last unless $ARGV[0] =~ m/^-/;
+ $_ = shift @ARGV;
+ last if m/^--?$/;
+ if (m/^-a$/) {
+ $listall=1;
+ } else {
+ die "unknown option to list \`$_'\n";
+ }
+ }
nomoreargs;
- my $q = $dbh->prepare("SELECT * FROM addrs WHERE user=?".
- " ORDER BY localpart");
+ my $q = "SELECT * FROM addrs WHERE user=?";
+ $q .= " AND NOT redirect = ''" unless $listall;
+ $q .= " ORDER BY localpart";
+ $q = $dbh->prepare($q);
$q->execute($user);
listq($q);
}