CTalkobt.Net




Programming Newsgroup Tips & Tricks CubeCart Stuff
Subject: Re: PHP mailer
From: Chris Hope
Date: Thu, 15 Sep 2005 09:56:37 +1200
Newsgroups: alt.comp.lang.php,comp.lang.php,alt.php
X-Mozilla-Status: 0011
X-Mozilla-Status2: 00000000
Path: bigbe2.bellsouth.net!bigfeed.bellsouth.net!news.bellsouth.net!newsfeed2.telusplanet.net!newsfeed.telus.net!cyclone.bc.net!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail
Newsgroups: alt.comp.lang.php,comp.lang.php,alt.php
Organization: Ihug Ltd
Lines: 41
Message-ID:
References: <43288e3f$0$97131$ed2619ec@ptn-nntp-reader03.plus.net>
NNTP-Posting-Host: 203-118-176-152.bliink.ihug.co.nz
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Trace: lust.ihug.co.nz 1126734989 14341 203.118.176.152 (14 Sep 2005 21:56:29 GMT)
X-Complaints-To: abuse@ihug.co.nz
NNTP-Posting-Date: Wed, 14 Sep 2005 21:56:29 +0000 (UTC)
User-Agent: KNode/0.9.1
Xref: bigfeed.bellsouth.net alt.comp.lang.php:19036 comp.lang.php:99137 alt.php:219822

Paul Marshall wrote:

Hi

I am my wits end!  I have a PHP script running that captures variables
posted from a form on the previous page.  The script then emails the
results using the mail() function.

The script is currently being spammed in two ways:

1) The page is being loaded directly, therefore emailing blank results
2) The variables are made up of an accepted email address (all
variables
are filled with it).  This email address is random, created using any
cobinations of characters before the accepted domain.

Does anyone have any ideas of how I can stop this?  The mails are
exceeding 60 per day now!  Obviously it is some form of program doing
it but I don't know of a way that I can stop it, either to restrict
the variables or the script page or what?

Any help would be much appreciated!

If all the fields are always being filled out with the same info then
check for that ie if they're all the same and they all contain your
email address then don't send the email.

I've noticed this happening on some of the sites I manage. Generally
what's actually happening is they're inserting a newline break in one
of the fields and attempting to add additional headers to the email
(including mime type headers to make it into a multipart document and
hide the rest of the submitted data). 

The way I've been combating this is to check none of the single line
fields (eg first name, last name etc) contain newline characters, and
none of the multi line fields (eg message) contain 'Content-Type:',
'multipart/mixed' or 'boundary='. If any of them match the above then
they get a message back saying the form contained invalid data.