From 763ff17973e6df2d676694052b7f0dd9aa3c71c3 Mon Sep 17 00:00:00 2001 From: short <> Date: Sat, 18 Oct 2003 19:46:28 +0000 Subject: [PATCH] +option --dump for unconditional --pending. --- perlmail-submit | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/perlmail-submit b/perlmail-submit index b367979..fce762a 100755 --- a/perlmail-submit +++ b/perlmail-submit @@ -162,15 +162,27 @@ sub submit 1 while submitonce(); } -sub pending +sub print_messages { - my $sth=$DBI->prepare("select message from $DB_table where retries is not null order by id"); +my($cond)=@_; + + my $sth=$DBI->prepare("select message from $DB_table $cond order by id"); $sth->execute(); while (my $row=$sth->fetchrow_hashref()) { print $row->{"message"},"\n"; } } +sub pending +{ + print_messages("where retries is not null"); +} + +sub dump +{ + print_messages(""); +} + sub clean { my($keyword,$interval)=@_; @@ -216,6 +228,7 @@ die if !GetOptions( "forkoff",\&forkoff, "submit" ,\&submit, "pending",\&pending, + "dump" ,\&dump, "clean:s",\&clean, "V|version",sub { print "perlmail-submit: $VERSION\n"; exit 0; }, ); -- 1.8.3.1