The "list" command now suppresses addresses that reject incoming mail
by default. If the -a command is specified, then they are listed as
before. The administrator's "list-user" command always shows all
aliases for a user, regardless of whether or not they are delivered.
[v3, squashed from
c9f544da6fba by iwj]
Signed-off-by: Matthew Vernon <matthewv@chiark.greenend.org.uk>
choose [<genopts>] [<redirect>] [#<comment>] (interactively allocate)
update <addr> [<redirect>] [#<comment>]
show <addr>
choose [<genopts>] [<redirect>] [#<comment>] (interactively allocate)
update <addr> [<redirect>] [#<comment>]
show <addr>
+ 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)
list-actions
empty string for redirect means reject
remember to quote comments (to protect # from your shell)
+ 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";
+ }
+ }
- 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);
}
$q->execute($user);
listq($q);
}