473,224 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

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 2664
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**********************@z14g2000cwz.googlegroups .com>,
"Zenbug" <ze****@gmail.com> 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.searchengineworld.com/robots/robots_tutorial.htm> and
<http://www.robotstxt.org/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
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...
1
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,...
6
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...
0
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...
4
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>...
7
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,...
4
by: ksukhonosenko | last post by:
This message was originally posted to comp.lang.c++.moderated ---------------------------------------------------------------------------------------------- Hi! I face a problem in my...
3
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...
12
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...
7
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
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.