Web Hosting Talk







View Full Version : email filter


navneet
12-08-2007, 04:55 AM
hi i am getting a lot of spam and want to create an email filter script in PHP which will parse the email and filter most of the spam.

I am using CPanel and the email processor seems to be exim

I can pipe the email to my php script but how will the script respond such that if it is not a spam it is delivered unedited. I have seen some example which would work with exit code but that would only work with qmail.

I need something that would work like qmail email filter exit code 0

Any help

jstanden
12-08-2007, 06:26 AM
Paul Graham has some excellent essays on Bayesian spam filtering. You can implement this in PHP if that's what you really want to do:
http://www.paulgraham.com/antispam.html

You can also return exit codes from PHP:
http://us2.php.net/exit

Really, if you're just worried about spam you're better off implementing a greylist or something instead of reinventing the wheel. ;)

If you're doing it for a project, then carry on!

navneet
12-08-2007, 07:01 AM
jeff,
thanks for the post but returning exit code is not my problem and i have the php code to filter the spam. The problem is after filtering how do i get the mails (the ones that are not spam) delivered after filtering.

Steve_Arm
12-08-2007, 07:24 AM
Have you read this?
http://www.exim.org/exim-html-3.30/doc/html/filter_10.html#SEC10