X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=blobdiff_plain;f=evade-mail-admin;fp=evade-mail-admin;h=4e5be404f34b863de11d7ea24b49c2c70e7aaf54;hb=0a3a970bcc7364e3bc72a2c722511aa57521c438;hp=fb22d3943a8e7e91e66c5e922b572927881673c2;hpb=7fb80d6d9ff5f5e4f0fc1c8cad19c0877a950d7f;p=evade-mail-usrlocal.git diff --git a/evade-mail-admin b/evade-mail-admin index fb22d39..4e5be40 100755 --- a/evade-mail-admin +++ b/evade-mail-admin @@ -22,7 +22,7 @@ actions choose [] [] [#] (interactively allocate) update [] [#] show - 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) @@ -409,9 +409,23 @@ sub listq ($) { } 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); }