Searching mail archives
Dave C
lists at hbcs.org
Thu Jan 17 15:04:45 GMT 2008
Julian Field wrote:
> -----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
>
And the Master teaches another apprentice.
( I really need to stop lurking on here ;-) )
--
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