PHP/shell script
Jonathan Hutchins
hutchins at tarcanfel.org
Fri Aug 15 20:02:32 CDT 2003
On Friday 15 August 2003 5:43 pm, brad wrote:
> I am trying to write a php script to allow a user to go to a web page
> and enter an email address or domain to be blocked or unblocked in the
> sendmail access file. The script needs to check the current access file
> to see if the address is already in there, add the address with the
> correct attribute (RELAY, or 550 REJECT We do not accept spam!) if its
> not in there, or return a notice to the user that the address is already
> blocked/released.
I would suggest a different approach.
First off, you don't want to give the "user" that Apache and PHP run as full
control of your sendmail. Any slip-up in your PHP code and you're a spam
generator instead of a filter.
PHP would have to a) re-hash the database of whatever control file you
modified, and b) restart sendmail - niether of which you want potentially
controlled by the web page.
Second, there are a number of existing spam filtration systems that allow
end-users to report spam, to whitelist specific addresses for themselves, to
report spam to clearinghouses so it can be blocked globally. Why reinvent
the wheel?
I'm not terribly happy with the current release of SpamAssassin, but that's
because I don't store mail on the server that's doing the filtering and it's
not easy for me to "train" the beysian filters. The earlier release without
those filters worked better for me, but gave some people too many false
positives.
The filters I know of don't use a PHP web page for end-user feedback, I think
they use a pseudo email address.
More information about the Kclug
mailing list