procmail
[Top] [All Lists]

Re: Using Message-ID as unique file name?

1997-07-14 07:48:00
Is it safe(possible) to use  Message-ID as unique file name
for later reference?

I don't think meta characters would hurt; however, a "/" wouldn't
work... also, I've seen spams with "Message-ID: <>" which is
certainly not unique (nor would it be unique if you got two copies
of the same mail such as this one... note that my copy direct to
you and the one you get from the list will have the same Message-ID).

Someone also pointed out to me long ago that if someone mails the same
message to two lists (and you're on both), the two messages you get will
probably have different message IDs.

The process-id in $$ is unique *while you're running*.  You ought to
be able to construct a unique filename from the date and time
in the "From " pseudo-header, combined with $$.  To refer to it
in the same recipe, just construct the name in a variable first.

I use this to get a unique logfile name for each message:

LOGFILE=$MAILDIR/Logs/`date '+%y%m%d_%H%M%S'`_$$

Note that another host could generate the same string, but that's
a pretty slim chance.

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