From owner-freebsd-questions@FreeBSD.ORG Wed Aug 17 15:17:36 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A5A116A41F for ; Wed, 17 Aug 2005 15:17:36 +0000 (GMT) (envelope-from kdk@daleco.biz) Received: from ezekiel.daleco.biz (southernuniform.com [66.76.92.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 29B8A43D46 for ; Wed, 17 Aug 2005 15:17:35 +0000 (GMT) (envelope-from kdk@daleco.biz) Received: from [192.168.2.2] ([69.27.149.254]) by ezekiel.daleco.biz (8.13.1/8.13.1) with ESMTP id j7HFHTEL016490; Wed, 17 Aug 2005 10:17:31 -0500 (CDT) (envelope-from kdk@daleco.biz) Message-ID: <43035504.4020300@daleco.biz> Date: Wed, 17 Aug 2005 10:17:24 -0500 From: Kevin Kinsey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050709 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Matt Juszczak References: <43034EA2.4000206@atopia.net> In-Reply-To: <43034EA2.4000206@atopia.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: OT: Removal of old 14+ mail from mbox-based mail spool (not maildir) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2005 15:17:36 -0000 Matt Juszczak wrote: > Hi all, > > Sorry this is off topic, just didn't really know where else to post > this other > than to fellow sys-admins. > > I need a script that will analyze a mail spool file and remove email > from it > that is more than 14 days old. I found a couple; however, they > require perl > modules I couldn't seem to find. Does anyone have any ideas? If not, > I'll go > ahead and write one. > > Thanks! > > -Matt "mail spool file" being /var/mail/someuser? Or do you mean dead mail in the /var/spool/mqueue *directory*? Technically the "mail spool" is a directory full of individuals files, as I understand it.... I'd think cleaning out a directory to be easier, but it isn't clear to me what you want. Also, a script in sh(1), or do you have some other language available? I have a short PHP script that does something similar and could be modded, perhaps. OTOH, somebody around here could probably give you a one-liner with sh, sed, grep, awk, date, test, etc., but I was at the hospital last night until 2 a.m. and don't think I can pull it off ATM.... Kevin Kinsey