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

Bart Schaefer <[email protected]>
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
On Tue, Mar 1, 2011 at 8:04 AM, Tim Rice <[email protected]> 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.