You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2007/01/31 14:08:43 UTC
svn commit: r501832 - /spamassassin/trunk/masses/mboxget
Author: jm
Date: Wed Jan 31 05:08:43 2007
New Revision: 501832
URL: http://svn.apache.org/viewvc?view=rev&rev=501832
Log:
add --ids switch to mboxget; just lists the ids, similar to awk '{print $3}'
Modified:
spamassassin/trunk/masses/mboxget
Modified: spamassassin/trunk/masses/mboxget
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/mboxget?view=diff&rev=501832&r1=501831&r2=501832
==============================================================================
--- spamassassin/trunk/masses/mboxget (original)
+++ spamassassin/trunk/masses/mboxget Wed Jan 31 05:08:43 2007
@@ -24,14 +24,15 @@
use Getopt::Long qw(:config bundling auto_help);
use Pod::Usage;
-use vars qw($opt_noannotate $opt_h);
+use vars qw($opt_noannotate $opt_h $opt_ids);
GetOptions("noannotate" => \$opt_noannotate,
+ "ids" => \$opt_ids,
"h|headers" => \$opt_h
);
=head1 NAME
-mboxget - Extract a message from an mbox (or other mail file)
+mboxget - Extract message(s) from an mbox (or other mail file)
=head1 SYNOPSIS
@@ -39,6 +40,7 @@
Options:
-h, --headers Display only message headers
+ --ids List only the IDs, do not generate an mbox
--noannotate Do not add X-Mass-Check-Id header with message path
=head1 DESCRIPTION
@@ -71,6 +73,10 @@
grep SUBJ_AS_SEEN spam.log | mboxget -h | grep ^Subject:
+To get the ids or paths of messages that hit SUBJ_AS_SEEN
+
+grep SUBJ_AS_SEEN spam.log | mboxget --ids
+
=cut
@@ -102,6 +108,12 @@
sub handle_input {
my $where = shift;
+
+ if ($opt_ids) {
+ print "$where\n";
+ return;
+ }
+
my ($file, $offset);
if (-f $where) {