Dear Sir,
I think i can help you with your project as i will make it using machine learning algorithm, if its what you want we will need to have training set consists of real mails and spams having the same features.
Have a good day
Thanks
Best Regards
Hany Aly