procmail
[Top] [All Lists]

Re: "deleted" folder

1999-11-03 04:00:00

i use pine/procmail with my email, and i was wondering if anybody knew how
i could set something up where the emails i deleted would go into a
"deleted" folder, and on a month to month basis, the "deleted" folder
would erase the emails inside? thanks for any help

I don't use pine, so I don't know how to modify the "delete" command
to save to a different folder. Erasing the "deleted" folder every month
sounds like a job for cron.

However, it may be that what you *really* want to do is to keep a copy
of all emails for a month. Here is a procmail recipe (taken from
Catherine A. Hampton's excellent Spam Bouncer package) which
keeps a backup copy of the last 100 email messages received:

# Create a backup cache of 100 most recent messages in case of mistakes
:0 c
backup

:0 ic
| cd backup && rm -f dummy `ls -t msg.* | sed -e 1,100d`


The first rule saves a copy of the message in a directory called "backup"
(which you should create in your main mail directory),
the second rule deletes all but the newest 100 messages in the directory.

A modification of this will delete messages more than a month old
(more than 30 days old, to be precise):

# Create a backup cache of one month's messages in case of mistakes
:0 c
backup

:0 ic
| cd backup && rm -f dummy `find . -type f -mtime +30 -print`


(Not tested, but it should work).

                        Martin

Martin(_dot_)Ward(_at_)durham(_dot_)ac(_dot_)uk http://www.dur.ac.uk/~dcs0mpw/ 
Erdos number: 4
Maintainer of the G.K.Chesterton web site: http://www.dur.ac.uk/~dcs0mpw/gkc/
Shortcuts: http://i.am/mw and http://i.am/gkc -- try them!
Vote against spam: http://www.politik-digital.de/spam/en/


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