The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script required to get a required info from file. Pls. help me. ntgobinath Shell Programming and Scripting 2 05-31-2008 05:34 AM
xen help required learnbash Linux 0 05-03-2008 06:46 AM
sendmail "root... User address required." error csgonan SUN Solaris 10 04-03-2008 06:57 AM
help required thaduka UNIX for Dummies Questions & Answers 5 02-14-2006 09:20 PM
Help required on DBX Sumanth SUN Solaris 1 07-29-2004 06:54 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-13-2008
Registered User
 

Join Date: Mar 2008
Posts: 55
sendmail help required

Hi,

i have a small query about sendmail, my all email are store in /var/spool/mail/test1
while test1 is the name of user, he is using that account from one year and all his emails are copied in server as well, because he choose the option leave a copy on server, now the size of folder is 20 GB, how can i delete the email of 8 months from this file.

Cheers,
Bash
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-13-2008
Registered User
 

Join Date: Mar 2008
Posts: 55
one common thing is that date in the file.

Tue Mar 4 14:20:23 2007
Reply With Quote
  #3 (permalink)  
Old 05-14-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,084
mbox files are just text files, however you should take care to not modify it while new mail is coming in. If you have the Procmail utilities (formail et al.) then lockfile -ml while you work on the file and lockfile -mu when you're done.

I would advise you to practice on a copy of the file until you see that what you have is working, then take a big gulp and do it on the live file.

Take care not to remove the message separators, each message should start with a "From " line (that's right, From with a space, not a colon, after it). To remove the oldest messages, just remove everything up to just before the first "From " line you want to preserve.

I really have to take exception with your way to bump your post and to direct it to me personally.
Reply With Quote
  #4 (permalink)  
Old 05-14-2008
Registered User
 

Join Date: Mar 2008
Posts: 55
because your solutions and ideas are cool, thanks for looking it.

Regards,
Bash
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0