Scott asked,
| I noticed when procmail saves messages to a directory, it gives them odd
| filenames like "msg.O5y".
For a classic procmail directory, yes. For an MH-style directory or a
qmail-style Maildir, the names are different.
| Is there any way to know what that filename is
| going to be? I need to pass that name to a perl script that's running.
OK, that confuses me. You want the perl script to know what the filename is
going to be *before* procmail creates it, when it doesn't exist yet? Because
if you are running the perl script after procmail saves the message and you
want perl to know what filename procmail already chose, it's in the LASTFOLDER
variable, and you could do something like this:
:0c # no local lockfile needed on save to directory
* conditions
directory
:0ai
| perlscript.pl $LASTFOLDER
or
:0
* conditions
{
TRAP='perlscript.pl $LASTFOLDER' # apostrophes, not backquotes
:0
directory
}
But the way your question phrased, you want to run the perl script, using the
name of a not-yet-existing file, before procmail saves the message there. I
can't think of a way to predict the name before procmail selects it and would
be fascinated to learn how if someone else here knows one.
| Or alternately, is there a way to specify what the output
| filename will be?
Well, yes.
:0i
* conditions
| perlscript.pl directory/filename
:0A:
directory/filename
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail