473,811 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to block a specific e-mail address?

My website has a mail form run by PHP, and I'm getting a lot of e-mails
sent through it that appear to contain my website's domain after the
'@', though I didn't send them. The e-mails contain no other content,
so I assume it's some kind of spam bot.

There must be a line of PHP that I can add that will basically say, "if
the e-mail address contains '@mydomainname. com', do not send."

I tried looking at php.net, but I can only find scripts that check if
the address is a valid one, which isn't good enough. I need to be able
to block a certain e-mail domain.

Thanks very much.
--ZenBug

Sep 5 '05 #1
6 2692
Zenbug said the following on 05/09/2005 19:45:
My website has a mail form run by PHP, and I'm getting a lot of e-mails
sent through it that appear to contain my website's domain after the
'@', though I didn't send them. The e-mails contain no other content,
so I assume it's some kind of spam bot.

There must be a line of PHP that I can add that will basically say, "if
the e-mail address contains '@mydomainname. com', do not send."


Regular expressions?
http://www.php.net/pcre

Or even a simple string search?
http://www.php.net/strpos

--
Oli
Sep 5 '05 #2
In article <11************ **********@z14g 2000cwz.googleg roups.com>,
"Zenbug" <ze****@gmail.c om> wrote:
My website has a mail form run by PHP, and I'm getting a lot of e-mails
sent through it that appear to contain my website's domain after the
'@', though I didn't send them. The e-mails contain no other content,
so I assume it's some kind of spam bot.

There must be a line of PHP that I can add that will basically say, "if
the e-mail address contains '@mydomainname. com', do not send."

I tried looking at php.net, but I can only find scripts that check if
the address is a valid one, which isn't good enough. I need to be able
to block a certain e-mail domain.

<?
if (!strstr($_POST["email"], "baddomain.com" )){
mail(...);
}
?>
--
Sandman[.net]
Sep 5 '05 #3
I would like to know what is causing this, as
it is happening to some of my site aswell.

Is there some new spambot out there?

Barry

Zenbug wrote:
My website has a mail form run by PHP, and I'm getting a lot of e-mails
sent through it that appear to contain my website's domain after the
'@', though I didn't send them. The e-mails contain no other content,
so I assume it's some kind of spam bot.

There must be a line of PHP that I can add that will basically say, "if
the e-mail address contains '@mydomainname. com', do not send."

I tried looking at php.net, but I can only find scripts that check if
the address is a valid one, which isn't good enough. I need to be able
to block a certain e-mail domain.

Thanks very much.
--ZenBug

Sep 6 '05 #4
My website has a mail form run by PHP, and I'm getting a lot of e-mails
sent through it that appear to contain my website's domain after the
'@', though I didn't send them. The e-mails contain no other content,
so I assume it's some kind of spam bot.


Just out of interest, can this form be submitted using a link? It may
be just a search engine bot clicking on everything to spider your site.
In that case, you can exclude the page with the form using robots.txt.

---
Steve

Sep 6 '05 #5
Thanks for the help, all.

Steve: In point of fact, yes, the code that sends the message is
contained in its own page, so if I load it up in a browser, a message
will be sent. I actually just added code that won't send the message
if the 'comments' field is left blank, so that should help if it's a
search engine spider.

Can you tell me how to use robots.txt though? That sounds like a good
idea anyway.

--ZenBug

Sep 6 '05 #6
Can you tell me how to use robots.txt though? That sounds like a good
idea anyway.


See <http://www.searchengin eworld.com/robots/robots_tutorial .htm> and
<http://www.robotstxt.o rg/wc/robots.html> for details. Note that only
compliant robots would be excluded; spam harvesters and the like will
ignore the file.

---
Steve

Sep 7 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
34295
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it could be possible to add Pythonistic syntax to Lisp or Scheme, while keeping all of the...
1
4221
by: Dave Mausner | last post by:
in general, how does css teach us to position blocks relative to one specific block? how does one specify which block is the reference for the position of others relative to it? for example, position block A somewhere; then create blocks B thru Z which intend to have specific positions relative to A--above, below, left, and right. i understood the standard to say "position:absolute" is actually relative to the most recently positioned...
6
6205
by: Sandman | last post by:
I'm having some problem here... I have a javascript I've downloaded that goes through all PNG files and enables the transparency channel in them for IE5.5+ by converting them to SPAN layers with the image as background. This works great until I put one of these PNG files inside a display:none block and later sets the block to display:block - then the SPAN (that was the PNG <img>) remains hidden.
0
2224
by: Jm | last post by:
Hi All I recently got some help with code conversion that i used in vb6 to block a specific tcp port. The code runs under a timer and is run on a very low tick count (Meaning it happens constantly). Unfortunately the code appears to do nothing ? This is the converted code Public Structure MIB_TCPROW Public dwState As Integer Public dwLocalAddr As Integer
4
2382
by: txican | last post by:
the HTML is: ---------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html> <head> <title>foo</title> <style type="text/css"> <!-- ..b {
7
1596
by: George | last post by:
Hi, Once the execution enters the "finally" block, the execution could have followed 1. normal/non-exception execution. (I guess everyone knows what I mean here.) 2. Exception was thrown, and handled. 3. Unhandled exception. Is there a way to find out which of above three has happened while in
4
2012
by: ksukhonosenko | last post by:
This message was originally posted to comp.lang.c++.moderated ---------------------------------------------------------------------------------------------- Hi! I face a problem in my production code. I could deduce this problem to program shown below. It seems, that try-block in constructor doesnt work as it should (compared to case where no try block exists at all). I tested this small program on my MSVC .NET Pro 2003 (and separately...
3
3239
by: David Golightly | last post by:
I'm taking a stab at making CSS sparklines - see http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR&topic_id=1&topic= <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <head> <title>Sparklines</title> <style type="text/css">
12
1842
by: Keith G Hicks | last post by:
I have a client that I wrote an MS Access app for quite a few years ago where they need to know the height in inches of a block of text for billing their customers. The MS Access app opens Word in the background, makes some settings (font, font size, margins, etc.) and gets the height. It's all worked quite well for 3 or 4 years. However, the whole thing is going to be redone for use in browsers in asp.net with vb.net. We want to...
7
1610
by: iu2 | last post by:
Hi, Playing with imitating lambdas and ruby blocks in Python, I came up with a very simple construct, for example: import compiler def dotimes(i, code): for i in range(i): exec code
0
10648
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10402
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10135
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9205
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6890
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.