Searching mail archives

Julian Field MailScanner at
Thu Jan 17 14:57:17 GMT 2008

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'


- -- 
Julian Field MEng CITP CEng
Buy the MailScanner book at

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

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


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