Searching mail archives

Denis Beauchemin Denis.Beauchemin at USherbrooke.ca
Thu Jan 17 20:00:23 GMT 2008


Nigel Kendrick a écrit :
> Thanks to all those who replied - I will have a play, but I just wanted to
> make sure that these searches will support multiple criteria - for example,
> I am looking for an email sent by 'joe.bloggs at ...' that probably has
> 'expenses' in the subject line and was sent to 'sue.smith at ..' with an .xls
> spreadsheet attached.
>
> Can you do that in one pass?
>
> Nigel 
>
>   
Nigel,

You could do something like this:
 grep -il 'crit3' $(grep -il 'crit2' $(grep -ril 'crit1' 
/var/spool/MailScanner/archive/200611??))

Basically the output of one search (the list of matching files) is used 
as the file list to search for the next search.  You can nest this as 
deep as you want.  It would probably be faster if the first search 
criteria returned a small number of hits.

Denis

-- 
   _
  °v°   Denis Beauchemin, analyste
 /(_)\  Université de Sherbrooke, S.T.I.
  ^ ^   T: 819.821.8000x62252 F: 819.821.8045




More information about the MailScanner mailing list