X-Git-Url: http://git.jankratochvil.net/?p=PerlMail.git;a=blobdiff_plain;f=perlmail-submit;h=fce762a3a5c96ae16a31aef535b3251ba2917fb7;hp=b367979f2612c9e4bb0a1bebf1e5b6de2c19ac3a;hb=763ff17973e6df2d676694052b7f0dd9aa3c71c3;hpb=0ed964cc851735c16ddf50743087e3f401afb07d 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; }, );