You can add an entry:

0 1 * * * /usr/bin/TrashClean.pl 1>/dev/null 2>&1

in root's crontab (or any user with write permission in the maildir
directory), and here's the *MORE*THAN*SIMPLE* script:

<CODE>
#!/usr/bin/perl -w

use strict;
use File::Find;

my (@dirs);

File::Find::find({wanted => \&wanted1}, "/home/corporate", "/home/vmail");

for (@dirs) {
  File::Find::find({wanted => \&wanted2}, $_);
}
exit;

sub wanted1 {
  return unless /^\.Trash\z/s;
  push @dirs, "$File::Find::dir/.Trash";
}

sub wanted2 {
  return unless /^(\d+)\./s;
  return unless time - $1 > 432000;
  unlink "$File::Find::dir/$_";
}
</CODE>

It does a recursive search at 00:01 every day through my 2 maildir stores
(one for local accounts and one for virtual domains) for the .Trash folder.
You should change "/home/corporate" and "/home/vmail" to your own maildir
repository.
And change that 432000 if you want, here I've chosen 5 days old deleted
messages (5 days * 24 hours * 60 minutes * 60 seconds);

HTH, later.-


----- Original Message -----
From: Nicolay Hoey
To: [EMAIL PROTECTED]
Sent: Thursday, January 10, 2002 11:13
Subject: [courier-users] How to get courier-imap empty trash


Hey...

How do I get courier-imap to empty users trash on my mailserver so that it
don`t get filled with old stuff and ending eathing all my space ?
Something like when an email have been in their trash i one week it will
automaticly be deleted.

I am runnnig qmail, vpopmail and courier-imap.


--
Venlig hilsen / Kind Regards
Nicolay H�y
[EMAIL PROTECTED] http://www.hoey.dk
ICQ: 7553073
Privat: +45 3617 3238
Mobil: +45 5182 3237


_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to