procmail
[Top] [All Lists]

Re: Message tag suffix

1997-09-03 15:57:08
Excerpts from mail: (03-Sep-97) Re: Message tag suffix by Robert Gahl
Yeah, I saw this unique piece in LASTFOLDER, but what I want is that
last piece, not the entire contents of LASTFOLDER. Now, I can write a
script to parse out that naughty bit, throwing away the other stuff.
I was just going to use procmail's "unique-o-fier" rather than just
write my own. I was hoping that that unique key it generated was
directly accessible rather than stripping it off of LASTFOLDER.

It's not, but stripping off the filename portion of LASTFOLDER is very simple
to do. This was discussed on the mailing list just last week. Just after

   :0c
   backup/

put the following recipe:

   :0
   * LASTFOLDER ?? backup/\/.+
   { MSGPREFIX = $MATCH }

Or, if you don't want to rely on the directory always being named "backup",
then the more generic form is (courtesy of David Tamkin):

   :0
   * LASTFOLDER ?? ()\/[^/]+$
   * MATCH ?? ^^\/.+
   { MSGPREFIX = $MATCH }

But if you're just want some string to uniquify what you are doing, you might
be able to just use $$ (the process ID number). That's much easier and,
assuming the need for the uniquifying string is short-term, probably just as
good as using the backup filename.

Later,
Ed

<Prev in Thread] Current Thread [Next in Thread>