procmail
[Top] [All Lists]

Re: How to use Procmail to remove messages from server after x number of days

2011-03-01 10:59:24
On 3/1/2011 11:17 PM, Bart Schaefer wrote:
On Tue, Mar 1, 2011 at 8:04 AM, Tim Rice<tim(_at_)phuket-mail(_dot_)com>  wrote:

I'm not sure if this is even possible, but I would like to automatically
remove all mail for all users after 10 days using Procmail.

Generally speaking, procmail is the wrong tool for this job.  Procmail
is designed to work on a single message provided as an input stream,
and deliver it to a mailbox; it's not a tool for manipulating messages
that are already contained in mailboxes.

Yes, you can kluge something together by e.g. using the formail
utility to break up the mailbox and send the messages through procmail
one by one, but that won't accomplish updating the mailbox in place --
you'll have to copy the mailbox, preserving only the messages that
have not yet expired, and then swap the copy for the original, all
while locking out new deliveries so as not to lose anything in the
swap.

You'll be better off looking for a tool that actually is able to
manipulate mailboxes rather than individual messages.

Hi Bart,

Thanks for the quick reply,

I thought that might be the case, but I see you guy's perform real magic on this list so I thought I'd ask the experts before looking for alternatives.

Thanks again for the excellent info.

____________________________________________________________
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




--
Best Regards,

Tim Rice
Computer Stuff
Phuket Thailand 83000
Tel: +66 76 376165
Fax: +66 76 376165
www.computerstuff.net
www.phuket-mail.com
____________________________________________________________
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

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