Forum Moderators: phranque
My host cancelled my account suddenly and without previous notification because "our data center is receiving Spamhaus complaints".
I don't carry out Spam and I only manage a blog and a
phpBB forum within my website.
I've browsed Spamhaus SBL and XBL lists:
[spamhaus.org...] [real IP removed]
and the IP of my server is not whithin these both black lists.
I've also checked other black lists:
[spam.deadbeef.com...]
[spamcop.net...]
and I don't find my IP.
Can anybody explain me a little more about this issue? I've got no idea about spam, my host support claims they "are investigating" and my website is down for 12 hours.
Thank you very much.
> Does your site have a shared or a unique IP address?
I share server with more than 50 websites. Mmmm... why is my host so sure about I'm to blame?
BTW, thank you very much Kaled for your answer.
The most likely source of any spam from your IP address is a vulnerable mail script. Do you use form mail? If not then there is almost no way for the blame to be yours. Also, if you do use form mail and the script was provided by your host, if it has been hacked, it's their fault for providing a vulnerable script.
Kaled.
email-form.html
-------------------
<form method=post action=send-mail.php>
Your email address:<br>
<input type="text" size="56" name="email"> <br>
Your name: <br>
<input type="text" size="56" name="name"> <br>
Text:<br>
<textarea name="text" rows=7 cols=60 wrap="off"></textarea> <br>
<input type="Submit" value="Send">
</form>
---------
send-mail.php
-----------
$to = "myemail@mydomain.com";
$subject = "Sent Menssage";
$body = "Message Body \n";
$body = $body . "----------------------- \n";
$body = $body . $email . "\n";
$body = $body . "----------------------- \n";
$body = $body . $name . "\n";
$body = $body . "----------------------- \n";
$body = $body . $text . "\n";
$headers = "From: $email";
mail($to,$subject,$body,$headers);
-------------
Could this script be vulnerable?
I hope this code is correct:
$to = $_POST['email'];
(See www.php.net and look up $_POST in the search.)
Using $_POST gets the data from the form (you have method=post).
If your script just says something like
$to = $email;
then it could get the address from the form, or from a URL. An automated script could access your script page through something like
http://www.example.com/send-mail.php?email=asdf@fdlkj.com
By the way, this is a neater way to write the $body, and a little more efficient than redoing $body each line:
$body = "Message Body \n"
. "----------------------- \n"
. $email . "\n"
. "----------------------- \n"
. $name . "\n"
. "----------------------- \n"
. $text . "\n";
[edited by: encyclo at 7:56 pm (utc) on Aug. 11, 2007]
'$to' value is within the PHP code (it's always 'myemail@mydomain.com' and this is my mailbox where I receive the messages), and I only get these values from the form:
$email (email og the person sending the message)
$name (name of the person sending the message)
$text (contents of the message)
You're right that it's better using:
$email = $_POST['email'];
$name = $_POST['name'];
$text = $_POST['text'];
But if you spoof these values, you cann't send spam to
anybody, since you cann't modify '$to' value, am I right?