procmail
[Top] [All Lists]

Re: Deleting a temporary file

2002-04-02 03:49:32
But I'm getting mixed up with delivering and non delivering recipes. I
always want the temp file to be deleted, but if I don't always want the mail
to go to DEFAULT. (If I have a delivering recipe in the brackets, the delete
never happens, but if I use the c flag, the mail always goes to the default
folder)

How to delete the temp file in this situation?

Define the TRAP variable.

'man procmailrc' says:

       TRAP        When  procmail  terminates it will execute the
                   contents of this variable.  A copy of the mail
                   can  be  read from stdin.  Any output produced
                   by this command will be appended to  $LOGFILE.
                   Possible  uses for TRAP are: removal of tempo-
                   rary files, logging customised abstracts, etc.

and 'man procmailex' says:

       If you are using temporary files in a procmailrc file, and
       want to make  sure  that  they  are  removed  just  before
       procmail  exits,  you  could use something along the lines
       of:

              TEMPORARY=$HOME/tmp/pmail.$$
              TRAP="/bin/rm -f $TEMPORARY"

Hope that helps,
Martin
-- 
Martin McCarthy                 /</                  PGP key available
    `Procmail Companion'        \>\  http://www.ancient-scotland.co.uk
     Addison Wesley             /</    http://www.ehabitat.demon.co.uk
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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