Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Aug 2005 10:17:24 -0500
From:      Kevin Kinsey <kdk@daleco.biz>
To:        Matt Juszczak <matt@atopia.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: OT: Removal of old 14+ mail from mbox-based mail spool (not maildir)
Message-ID:  <43035504.4020300@daleco.biz>
In-Reply-To: <43034EA2.4000206@atopia.net>
References:  <43034EA2.4000206@atopia.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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