Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Dec 2003 11:00:55 -0800
From:      Bill Campbell <freebsd@celestial.com>
To:        freebsd-isp@freebsd.org
Subject:   Re: Managing Maildirs
Message-ID:  <20031219190055.GD85955@alexis.mi.celestial.com>
In-Reply-To: <20031219165302.GA51410@ns2.wananchi.com>
References:  <20031219165302.GA51410@ns2.wananchi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 19, 2003, Odhiambo Washington wrote:
>Hiya all,
>
>Okay. I have users who are not "very familiar with these thing, you
>know" as they always tell me ;)
>Noone cleans their Trash folder when they access their mail via the imap
>server. I would like to do it for them, but I am not sure I get it
>right. I have read the man page of find, but just to be sure, can I do
>
>1. find /home/*/Maildir/.Trash/ -type f | xargs rm ??
>2. find /var/spool/virtual/*/*/Maildir/.Trash/ -type f -exec rm {} \;
>
>The * in (1) is like /home/wash/Maildir/.Trash/ and the * in (2)
>is like /var/spool/virtual/domain.tld/user1/Maildir/
>
>How are others dealing with this situation? Any good tools?

Number one above will do the trick and is far more efficient than using the
``find ...-exec'', although you might want to modify it to only nuke mail
over a certain age.  To nuke all trash over 30 days old:

	find /home/*/Maildir/.Trash -type f -mtime +30 | xargs rm

Bill
--
INTERNET:   bill@Celestial.COM  Bill Campbell; Celestial Software LLC
UUCP:               camco!bill  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

Breathe fire, slay dragons, and take chances. Failure is temporary, regret
is eternal.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031219190055.GD85955>