How to block a specific e-mail address?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Zenbug

    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

  • Oli Filth

    #2
    Re: How to block a specific e-mail address?

    Zenbug said the following on 05/09/2005 19:45:[color=blue]
    > 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."
    >[/color]

    Regular expressions?
    Regular Expressions (Perl-Compatible)


    Or even a simple string search?
    Find the position of the first occurrence of a substring in a string




    --
    Oli

    Comment

    • Sandman

      #3
      Re: How to block a specific e-mail address?

      In article <1125945945.517 674.260180@z14g 2000cwz.googleg roups.com>,
      "Zenbug" <zenbug@gmail.c om> wrote:
      [color=blue]
      > 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.[/color]


      <?
      if (!strstr($_POST["email"], "baddomain.com" )){
      mail(...);
      }
      ?>


      --
      Sandman[.net]

      Comment

      • Barry

        #4
        Re: How to block a specific e-mail address?

        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:[color=blue]
        > 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
        >[/color]

        Comment

        • Steve

          #5
          Re: How to block a specific e-mail address?

          [color=blue]
          > 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.[/color]

          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

          Comment

          • Zenbug

            #6
            Re: How to block a specific e-mail address?

            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

            Comment

            • Steve

              #7
              Re: How to block a specific e-mail address?

              [color=blue]
              > Can you tell me how to use robots.txt though? That sounds like a good
              > idea anyway.[/color]

              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

              Comment

              Working...