procmail
[Top] [All Lists]

RE: how to deliver to a file with a unique time-stamped file name, reliably?

2005-01-18 17:50:45

FIND="TEXT-TO-FIND"
MYDATE=`date '+%d%m%Y%H%M%S'`
:0
* ^TO_user(_at_)domain(_dot_)com
* $ B ?? $FIND
{ 
  :0c # Write the email, fork a copy
  $MYDATE

   :0a # process the copy of the mail
   |  /tmp/processmail.sh
}

Not bad, but how do we make sure that the file named by $MYDATE
isn't overwritten by another process executing this script within
the same second in time?


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail