+option --dump for unconditional --pending.
authorshort <>
Sat, 18 Oct 2003 19:46:28 +0000 (19:46 +0000)
committershort <>
Sat, 18 Oct 2003 19:46:28 +0000 (19:46 +0000)
perlmail-submit

index b367979..fce762a 100755 (executable)
@@ -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; },
                );