git://git.jankratochvil.net
/
PerlMail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
+option --dump for unconditional --pending.
[PerlMail.git]
/
perlmail-submit
diff --git
a/perlmail-submit
b/perlmail-submit
index
b367979
..
fce762a
100755
(executable)
--- a/
perlmail-submit
+++ b/
perlmail-submit
@@
-162,15
+162,27
@@
sub submit
1 while submitonce();
}
1 while submitonce();
}
-sub p
ending
+sub p
rint_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";
}
}
$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)=@_;
sub clean
{
my($keyword,$interval)=@_;
@@
-216,6
+228,7
@@
die if !GetOptions(
"forkoff",\&forkoff,
"submit" ,\&submit,
"pending",\&pending,
"forkoff",\&forkoff,
"submit" ,\&submit,
"pending",\&pending,
+ "dump" ,\&dump,
"clean:s",\&clean,
"V|version",sub { print "perlmail-submit: $VERSION\n"; exit 0; },
);
"clean:s",\&clean,
"V|version",sub { print "perlmail-submit: $VERSION\n"; exit 0; },
);