procmail
[Top] [All Lists]

Re: access & modification times of mail folders

1998-01-17 14:25:05
Dmitry Yaitskov asked,

| I have come up with the following recipe that works:
| 
| :0:
| * ^TOwhatever
| {
|    :0 c
|    folder/.
| 
|    :0
|    | touch -m ~/Mail/$LASTFOLDER
| }
| 
| which does what I want.... but looks kinda ugly, especially
| considering that I have to repeat all this for each folder that gets
| new mail. Is there a better way to do what I want? Thanks.

First thought: put

TRAP='touch -m $HOME/Mail/$LASTFOLDER' # with strong quotes

early in your rcfile; then each recipe that saves to a directory can look
simply like this, and the trap will take care of the touching:

  :0 flags # no local lockfile needed for save to directory
  * conditions
  directoryname/.

Besides, your current setup needs an `i' flag on the recipes that call
touch, or procmail will scream bloody murder about write errors.

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