sort mail based on subject in unix.

Hi,
I have a complicated requirement.I need to search for a particular pattern in the subject of incoming mail to a set of users and need to save the content of the mail in a file which will be uploaded to a file server.

I have a perl script to do the upload.I need a script to sort the mail based on the subject and copy the content of the mail to a file.

Can anybody suggest me how to do this....Sorry i am not that much good in writing scripts based on logic.

i will be thankful even if u can suggest me a free utility available...:slight_smile:

Thanks.
Sriram.S

Check out "procmail"

Ye, procmail is your first choice, here's a link to a tutorail