Re: OT: Removal of old 14+ mail from mbox-based mail spool (not maildir)

From: Matt Juszczak (matt_at_atopia.net)
Date: 08/17/05

  • Next message: vladone: "problem with vsftpd. filesystem full"
    Date: Wed, 17 Aug 2005 11:58:43 -0400
    To: Kevin Kinsey <kdk@daleco.biz>
    
    

    | 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
    >

    I want to clean out an IMAP "folder" (actually file $HOME/mail/Spam).
    We have about 10,000 users and our users don't check their spam
    quarantine often, so our policy is to remove messages after 14 days.

    I know how to:

    1) recursively pull each Spam folder in existance (for x in `ls
    /home/*/mail/Spam`; do ....; done)
    2) Use grep and awk to pull each message and its relative data (grep the
    date, parse it)

    What I'm not sure of is how to remove a message from the spool itself.
    Should I just use grep and/or sed to "pull until new From header", then
    remove those lines from the spool manually?

    This would be easier if I could use IMAP, because then I could use the
    built-in PHP functions for imap to check dates and remove messages.
    Problem is, we don't know the user's passwords (they are hashed).

    Any other ideas? Thanks!

    -Matt
    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"


  • Next message: vladone: "problem with vsftpd. filesystem full"

    Relevant Pages

    • Re: Grep For Line Containing 1or 2 Words
      ... > Looking for help in writing a grep (or perl) that will pull from a text file ...
      (comp.os.linux.misc)
    • Re: Multiple NICS and recording IP addresses
      ... that only works for statis IP addresses; I need this to work for DHCP ... I am trying to enumerate ... and pull it out of the subkeys but am having trouble. ... >>all NICS as below without relying on grep? ...
      (microsoft.public.scripting.vbscript)
    • [opensuse] grep question
      ... Can I use grep to pull all the address out? ... WartHog Bulletin ... Anti-US Propaganda stamp collection ...
      (SuSE)
    • php grep
      ... i am looking for a way to grep through a LARGE text file quickly and ... i need to pull out just one line of the file. ... the most efficient method so far to be: ... Prev by Date: ...
      (alt.php)
    • Grep For Line Containing 1or 2 Words
      ... Looking for help in writing a grep (or perl) that will pull from a text file ...
      (comp.os.linux.misc)