How can we delete mail after X days?

If you have a program or script that you'd like to give away or sell, this is the place to do it. All offers should include contact info.

Moderators: BBear, theunknownhost, flaguy

Post Reply
User avatar
Sapphyre
Official Test Penquin
Posts: 3337
Joined: Tue Nov 19, 2002 2:50 am
Location: Canada

How can we delete mail after X days?

Post by Sapphyre » Wed Jun 28, 2006 5:49 pm

Does anyone know of a script which can be run via cron to delete mail over X days old? Client forwarding mail to read elsewehere. Keeps a backup copy on server to access via webmail. Does not POP from our server, only uses webmail occasionally. Wishes to have mail over 30 days old deleted automatically.

One idea I am going to play with is symlinking the webmail Saved and Trash folders. Set webmail to move old messages to 'Saved' at logout. Set the trash to delete messages over 30 days old. But this will only work if the customer logs in regularly, correct? Is the trash only emptied when the client uses webmail the same as the filtering?

Do you know of a preexisting script than can do this?

User avatar
Arf
Official Test Penquin
Posts: 9103
Joined: Tue Apr 09, 2002 12:00 am
Location: IDAHO, USA
Contact:

Re: How can we delete mail after X days?

Post by Arf » Wed Jun 28, 2006 6:40 pm

Sapphyre wrote:Set the trash to delete messages over 30 days old. But this will only work if the customer logs in regularly, correct? Is the trash only emptied when the client uses webmail the same as the filtering?

Do you know of a preexisting script than can do this?

I believe so, yes yes and no to these questions. I don't think there's a script that will do this on webmail files. Email Plumber does this on a regular email box file.

User avatar
Sapphyre
Official Test Penquin
Posts: 3337
Joined: Tue Nov 19, 2002 2:50 am
Location: Canada

Post by Sapphyre » Wed Jun 28, 2006 8:52 pm

Can email plumber do this via cron for one account only?

I did find 'archivemail'
http://archivemail.sourceforge.net/
...but it's not compatible

Oh, but we'll have a go with this one ... stay tuned:
http://adc-archmbox.sourceforge.net/

User avatar
Arf
Official Test Penquin
Posts: 9103
Joined: Tue Apr 09, 2002 12:00 am
Location: IDAHO, USA
Contact:

Post by Arf » Wed Jun 28, 2006 9:49 pm

Sapphyre wrote:Can email plumber do this via cron for one account only?
Fraid not.

jady

Post by jady » Wed Jul 19, 2006 1:58 am

We actually set a cron to delete ONE email account mail file every night at midnight. Using the CP cron manager like this:

cd /home/USER/DOMAIN-mail/; rm info -f

Where as the email account "info" was being deleted nightly. Been working well. Do it because Blackberry's and Treo phones dont like to remove mail from the server. Hope this helps!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest