Searching mail archives

Julian Field MailScanner at ecs.soton.ac.uk
Thu Jan 17 14:57:17 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Dave C wrote:
> Nigel Kendrick wrote:
>> Hi,
>>
>> I need to search a months-worth of mail archives
>> (/var/spool/MailScanner/archive/200611**) for a specific sender, 
>> subject and
>> attachment. I have had a play with grep and awk but I am not doing very
>> well!!
>>
>> Are there any utilities to help or can anyone suggest a sensible command
>> line that will do the job?
>>
>> Thanks
>>
>> Nigel Kendrick
>>
> This works pretty good for me.. (watch the word wrap and the 
> searchterm needs to be in single quotes)
>
> find /var/spool/MailScanner/archive/200611?? -type f -name df\* -exec 
> grep -il 'searchterm' {} \; 
What is enormously faster is
find /var/spool/MailScanner/archive/200611?? -type f -name df\* -print | 
xargs grep -il 'searchterm'

Jules

- -- 
Julian Field MEng CITP CEng
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store

Need help customising MailScanner?
Contact me!
Need help fixing or optimising your systems?
Contact me!
Need help getting you started solving new requirements from your boss?
Contact me!

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654


-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.7.0 (Build 1012)
Comment: (pgp-secured)
Charset: ISO-8859-1

wj8DBQFHj2zOEfZZRxQVtlQRAsDWAJ9LrgtMVZxZ/IzAsc8tgwBvNeNmEgCgvZPD
+InZ5WUBxS2N1em1pfWUFtk=
=ytrC
-----END PGP SIGNATURE-----

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the MailScanner mailing list