![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
|||
|
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. |