On Mon, 4 Oct 1999 16:28:06 -0500, "Tam Vuong"
<tamv(_at_)harmonic(_dot_)untpdc(_dot_)org> wrote:
and I am trying to make an index of the files in the following format.
mymaildir/2 Subject: .......
mymaildir/3 Subject: .......
How can I get the file name?
Procmail's log file contains all the information you need, if you use
LOGABSTRACT=ALL
At the moment I am using
`ls -t |sed -n -e '1 p'`
The log file is definitely better if you can use it. It's easy to add
information at delivery time if you want stats of some other field:
:0
* ^Message-Id:[ ]*\/[^ ].*
{ LOG="Message-Id: $MATCH
" }
The only problem is that if two messages arrive at roughly the same
time, you get mangled log entries. You can use a global lock file to
prevent that, though.
If you don't have the log file on store anymore, you can do something
like
grep -i '^Subject:' mymaildir/* /dev/null | sort -t : -n
and perhaps pipe that into an awk script to weed out any duplicates
(which will occur if the body of a message, too, contains a match on
the regular expression) and, of course, change the first colon into a
tab (or whatever).
Hope this helps,
/* era */
--
Too much to say to fit into this .signature anyway: <http://www.iki.fi/era/>
Fight spam in Europe: <http://www.euro.cauce.org/> * Sign the EU petition