PHP mail being marked as spam

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

    PHP mail being marked as spam

    I'm working on a reset password script for my CMS, that will generate
    a random password and email it to a user when they request one. The
    problem I am having is that the mails being sent out are beign marked
    as spam by our internal mail system and never reaching users'
    inboxes. I've also discovered that Yahoo Mail considers these mails
    to be spam, but it moves them to the spam folder instead of just
    dropping them.

    I wrote a simple mail script for testing purposes at http :// cms .
    merus . co . uk / mailtest . php (remove whitespace for correct URL)
    in an attempt to figure it out and have been using it to send myself
    messages to my yahoo inbox in an attempt to figure out why they are
    being marked as spam. The script source code is as follows:

    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitl ed Document</title>
    </head>
    <body>
    <form id="form1" method="post" action="">
    <p>
    <label for="to">To</label>
    <input type="text" name="to" id="to" />
    </p>
    <p>
    <label for="subj">Subj ect</label>
    <input type="text" name="subj" id="subj" />
    </p>
    <p>
    <label for="msg">Messa ge</label>
    <textarea name="msg" cols="60" rows="8" id="msg"></textarea>
    </p>
    <p>
    <label for="Submit">Su bmit</label>
    <input type="submit" name="Submit" value="Submit" id="Submit" />
    </p>
    </form>
    </body>
    </html>
    <?php
    $headers = 'From: cms@cms.merus.c o.uk
    Return-Path: cms@cms.merus.c o.uk
    Reply-To: cms@cms.merus.c o.uk
    X-Mailer: PHP '.phpversion ().'
    ';
    if ($_POST)
    {
    var_dump (mail ($_POST ['to'], $_POST ['subj'], $_POST ['msg'],
    $headers));
    }
    ?>

    I've examined the headers that Yahoo sees with the view full headers
    feature, but nothing that would obviously get the message flagged as
    spam came up, though the X-Mailer header seems to be missing. If
    anyone else can take a look at this and provide some helpful insight
    I'd appreciate it.
  • Jerry Stuckle

    #2
    Re: PHP mail being marked as spam

    Gordon wrote:
    I'm working on a reset password script for my CMS, that will generate
    a random password and email it to a user when they request one. The
    problem I am having is that the mails being sent out are beign marked
    as spam by our internal mail system and never reaching users'
    inboxes. I've also discovered that Yahoo Mail considers these mails
    to be spam, but it moves them to the spam folder instead of just
    dropping them.
    >
    I wrote a simple mail script for testing purposes at http :// cms .
    merus . co . uk / mailtest . php (remove whitespace for correct URL)
    in an attempt to figure it out and have been using it to send myself
    messages to my yahoo inbox in an attempt to figure out why they are
    being marked as spam. The script source code is as follows:
    >
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitl ed Document</title>
    </head>
    <body>
    <form id="form1" method="post" action="">
    <p>
    <label for="to">To</label>
    <input type="text" name="to" id="to" />
    </p>
    <p>
    <label for="subj">Subj ect</label>
    <input type="text" name="subj" id="subj" />
    </p>
    <p>
    <label for="msg">Messa ge</label>
    <textarea name="msg" cols="60" rows="8" id="msg"></textarea>
    </p>
    <p>
    <label for="Submit">Su bmit</label>
    <input type="submit" name="Submit" value="Submit" id="Submit" />
    </p>
    </form>
    </body>
    </html>
    <?php
    $headers = 'From: cms@cms.merus.c o.uk
    Return-Path: cms@cms.merus.c o.uk
    Reply-To: cms@cms.merus.c o.uk
    X-Mailer: PHP '.phpversion ().'
    ';
    if ($_POST)
    {
    var_dump (mail ($_POST ['to'], $_POST ['subj'], $_POST ['msg'],
    $headers));
    }
    ?>
    >
    I've examined the headers that Yahoo sees with the view full headers
    feature, but nothing that would obviously get the message flagged as
    spam came up, though the X-Mailer header seems to be missing. If
    anyone else can take a look at this and provide some helpful insight
    I'd appreciate it.
    >
    Among other things, ALWAYS specify the line end characters. Do not just
    continue strings on separate lines and hope the browser has inserted the
    correct characters!

    Additionally, talk to your sysadmins and find out what they have set up
    to detect for spam.


    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Joe Butler

      #3
      Re: PHP mail being marked as spam

      Hotmail also spammed it.

      Is it possible that it's because the received from server is nothing to do
      with the 'from' address?

      Just a stab in the dark: do you have an spf record to show that your server
      can send on behalf of your domain name.



      "Gordon" <gordon.mcvey@n tlworld.comwrot e in message
      news:32941325-01c1-4bc9-9eda-6ad67b9b4621@m7 3g2000hsh.googl egroups.com...
      I'm working on a reset password script for my CMS, that will generate
      a random password and email it to a user when they request one. The
      problem I am having is that the mails being sent out are beign marked
      as spam by our internal mail system and never reaching users'
      inboxes. I've also discovered that Yahoo Mail considers these mails
      to be spam, but it moves them to the spam folder instead of just
      dropping them.
      >
      I wrote a simple mail script for testing purposes at http :// cms .
      merus . co . uk / mailtest . php (remove whitespace for correct URL)
      in an attempt to figure it out and have been using it to send myself
      messages to my yahoo inbox in an attempt to figure out why they are
      being marked as spam. The script source code is as follows:
      >
      <!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">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Untitl ed Document</title>
      </head>
      <body>
      <form id="form1" method="post" action="">
      <p>
      <label for="to">To</label>
      <input type="text" name="to" id="to" />
      </p>
      <p>
      <label for="subj">Subj ect</label>
      <input type="text" name="subj" id="subj" />
      </p>
      <p>
      <label for="msg">Messa ge</label>
      <textarea name="msg" cols="60" rows="8" id="msg"></textarea>
      </p>
      <p>
      <label for="Submit">Su bmit</label>
      <input type="submit" name="Submit" value="Submit" id="Submit" />
      </p>
      </form>
      </body>
      </html>
      <?php
      $headers = 'From: cms@cms.merus.c o.uk
      Return-Path: cms@cms.merus.c o.uk
      Reply-To: cms@cms.merus.c o.uk
      X-Mailer: PHP '.phpversion ().'
      ';
      if ($_POST)
      {
      var_dump (mail ($_POST ['to'], $_POST ['subj'], $_POST ['msg'],
      $headers));
      }
      ?>
      >
      I've examined the headers that Yahoo sees with the view full headers
      feature, but nothing that would obviously get the message flagged as
      spam came up, though the X-Mailer header seems to be missing. If
      anyone else can take a look at this and provide some helpful insight
      I'd appreciate it.

      Comment

      • Jerry Stuckle

        #4
        Re: PHP mail being marked as spam

        Michael Vilain wrote:
        In article
        <32941325-01c1-4bc9-9eda-6ad67b9b4621@m7 3g2000hsh.googl egroups.com>,
        Gordon <gordon.mcvey@n tlworld.comwrot e:
        >
        >I'm working on a reset password script for my CMS, that will generate
        >a random password and email it to a user when they request one. The
        >problem I am having is that the mails being sent out are beign marked
        >as spam by our internal mail system and never reaching users'
        >inboxes. I've also discovered that Yahoo Mail considers these mails
        >to be spam, but it moves them to the spam folder instead of just
        >dropping them.
        >>
        >I wrote a simple mail script for testing purposes at http :// cms .
        >merus . co . uk / mailtest . php (remove whitespace for correct URL)
        >in an attempt to figure it out and have been using it to send myself
        >messages to my yahoo inbox in an attempt to figure out why they are
        >being marked as spam. The script source code is as follows:
        >>
        ><!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">
        ><head>
        ><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        ><title>Untitle d Document</title>
        ></head>
        ><body>
        ><form id="form1" method="post" action="">
        > <p>
        > <label for="to">To</label>
        > <input type="text" name="to" id="to" />
        > </p>
        > <p>
        > <label for="subj">Subj ect</label>
        > <input type="text" name="subj" id="subj" />
        > </p>
        > <p>
        > <label for="msg">Messa ge</label>
        > <textarea name="msg" cols="60" rows="8" id="msg"></textarea>
        > </p>
        > <p>
        > <label for="Submit">Su bmit</label>
        > <input type="submit" name="Submit" value="Submit" id="Submit" />
        > </p>
        ></form>
        ></body>
        ></html>
        ><?php
        >$headers = 'From: cms@cms.merus.c o.uk
        >Return-Path: cms@cms.merus.c o.uk
        >Reply-To: cms@cms.merus.c o.uk
        >X-Mailer: PHP '.phpversion ().'
        >';
        >if ($_POST)
        >{
        > var_dump (mail ($_POST ['to'], $_POST ['subj'], $_POST ['msg'],
        >$headers));
        >}
        >?>
        >>
        >I've examined the headers that Yahoo sees with the view full headers
        >feature, but nothing that would obviously get the message flagged as
        >spam came up, though the X-Mailer header seems to be missing. If
        >anyone else can take a look at this and provide some helpful insight
        >I'd appreciate it.
        >
        If an ISP is flagging your email as spam, there's not much you can do to
        fix that. Usually this is done based on the email history of the IP
        address that's sending the emails. For something like SPAMCOP where
        people actually report spammers to the service, the list is dynamic.
        For Yahoo, it's up to them whatever method they use--baysian filters,
        phase-of-the-moon, or the fact that your ISP won't get rid of spammers.
        >
        According to senderbase.org, your mail host has a good record of
        non-spamming activity:
        >

        8.135.54
        >
        But the content of the message may look spammy to the baysian filters.
        Stuff like the "From" and "Return-path" and "Reply" not matching as well
        as the body containing HTML or attachments might trigger the filters.
        There's nothing you can do about this except make the email as
        transparent as possible. NO HTML, attachments, embedded pictures, and
        good headers.
        >
        Actually, rbl's are now among the lesser used methods of detecting spam.
        Sure, they're used - but header checking and message parsing end up
        catching much of the spam.

        Ensuring the headers are correct is a good first step. If your message
        is otherwise not spam, that should get you to most of your users.

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • Gordon

          #5
          Re: PHP mail being marked as spam

          On Sep 1, 3:46 pm, "Joe Butler" <ffffh.no.s...@ hotmail-spammers-
          paradise.comwro te:
          Hotmail also spammed it.
          >
          Is it possible that it's because the received from server is nothing to do
          with the 'from' address?
          >
          Just a stab in the dark: do you have an spf record to show that your server
          can send on behalf of your domain name.http://en.wikipedia.org/wiki/Sender_Policy_Framework
          >
          "Gordon" <gordon.mc...@n tlworld.comwrot e in message
          >
          news:32941325-01c1-4bc9-9eda-6ad67b9b4621@m7 3g2000hsh.googl egroups.com...
          >
          I'm working on a reset password script for my CMS, that will generate
          a random password and email it to a user when they request one. The
          problem I am having is that the mails being sent out are beign marked
          as spam by our internal mail system and never reaching users'
          inboxes. I've also discovered that Yahoo Mail considers these mails
          to be spam, but it moves them to the spam folder instead of just
          dropping them.
          >
          I wrote a simple mail script for testing purposes at http :// cms .
          merus . co . uk / mailtest . php (remove whitespace for correct URL)
          in an attempt to figure it out and have been using it to send myself
          messages to my yahoo inbox in an attempt to figure out why they are
          being marked as spam. The script source code is as follows:
          >
          <!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">
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <title>Untitl ed Document</title>
          </head>
          <body>
          <form id="form1" method="post" action="">
          <p>
          <label for="to">To</label>
          <input type="text" name="to" id="to" />
          </p>
          <p>
          <label for="subj">Subj ect</label>
          <input type="text" name="subj" id="subj" />
          </p>
          <p>
          <label for="msg">Messa ge</label>
          <textarea name="msg" cols="60" rows="8" id="msg"></textarea>
          </p>
          <p>
          <label for="Submit">Su bmit</label>
          <input type="submit" name="Submit" value="Submit" id="Submit" />
          </p>
          </form>
          </body>
          </html>
          <?php
          $headers = 'From: c...@cms.merus. co.uk
          Return-Path: c...@cms.merus. co.uk
          Reply-To: c...@cms.merus. co.uk
          X-Mailer: PHP '.phpversion ().'
          ';
          if ($_POST)
          {
          var_dump (mail ($_POST ['to'], $_POST ['subj'], $_POST ['msg'],
          $headers));
          }
          ?>
          >
          I've examined the headers that Yahoo sees with the view full headers
          feature, but nothing that would obviously get the message flagged as
          spam came up, though the X-Mailer header seems to be missing. If
          anyone else can take a look at this and provide some helpful insight
          I'd appreciate it.
          GMail doesn't seem to mark it as spam.

          I don't think it's the return path that's triggering the spam filters,
          because it still gets marked as spam if From is set to be the same as
          the server mentioned in the return path. I've emailed our IT
          department about the filtering used, but they've not gotten back to
          me, and they're not much help when it comes to problems that can't be
          solved by turning it off and on again.

          Comment

          • Joe Butler

            #6
            Re: PHP mail being marked as spam

            Do the headers of (unrelated) mails that do get thru to your internal mail
            have headers that give a clue to what anti-spam system is in use. With that
            info, you might be able to tweak things to work.

            Also, was the 'from address' an actual mailbox on the other server, or was
            it just random@otherser ver-hosts.com - becuase if it doesn't exist, it might
            get dropped by your internal server.

            And you are saying your internal server is marking it as spam, but you are
            also saying it's not getting thru. So, how do you know it is marking it as
            spam? Just because yahoo is?



            "Gordon" <gordon.mcvey@n tlworld.comwrot e in message
            news:62f159a8-a701-4434-ba23-ccc1eee327c4@y2 1g2000hsf.googl egroups.com...
            On Sep 1, 3:46 pm, "Joe Butler" <ffffh.no.s...@ hotmail-spammers-
            paradise.comwro te:
            >Hotmail also spammed it.
            >>
            >Is it possible that it's because the received from server is nothing to
            >do
            >with the 'from' address?
            >>
            >Just a stab in the dark: do you have an spf record to show that your
            >server
            >can send on behalf of your domain
            >name.http://en.wikipedia.org/wiki/Sender_Policy_Framework
            >>
            >"Gordon" <gordon.mc...@n tlworld.comwrot e in message
            >>
            >news:3294132 5-01c1-4bc9-9eda-6ad67b9b4621@m7 3g2000hsh.googl egroups.com...
            >>
            I'm working on a reset password script for my CMS, that will generate
            a random password and email it to a user when they request one. The
            problem I am having is that the mails being sent out are beign marked
            as spam by our internal mail system and never reaching users'
            inboxes. I've also discovered that Yahoo Mail considers these mails
            to be spam, but it moves them to the spam folder instead of just
            dropping them.
            >>
            I wrote a simple mail script for testing purposes at http :// cms .
            merus . co . uk / mailtest . php (remove whitespace for correct URL)
            in an attempt to figure it out and have been using it to send myself
            messages to my yahoo inbox in an attempt to figure out why they are
            being marked as spam. The script source code is as follows:
            >>
            <!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">
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <title>Untitl ed Document</title>
            </head>
            <body>
            <form id="form1" method="post" action="">
            <p>
            <label for="to">To</label>
            <input type="text" name="to" id="to" />
            </p>
            <p>
            <label for="subj">Subj ect</label>
            <input type="text" name="subj" id="subj" />
            </p>
            <p>
            <label for="msg">Messa ge</label>
            <textarea name="msg" cols="60" rows="8" id="msg"></textarea>
            </p>
            <p>
            <label for="Submit">Su bmit</label>
            <input type="submit" name="Submit" value="Submit" id="Submit" />
            </p>
            </form>
            </body>
            </html>
            <?php
            $headers = 'From: c...@cms.merus. co.uk
            Return-Path: c...@cms.merus. co.uk
            Reply-To: c...@cms.merus. co.uk
            X-Mailer: PHP '.phpversion ().'
            ';
            if ($_POST)
            {
            var_dump (mail ($_POST ['to'], $_POST ['subj'], $_POST ['msg'],
            $headers));
            }
            ?>
            >>
            I've examined the headers that Yahoo sees with the view full headers
            feature, but nothing that would obviously get the message flagged as
            spam came up, though the X-Mailer header seems to be missing. If
            anyone else can take a look at this and provide some helpful insight
            I'd appreciate it.
            >
            GMail doesn't seem to mark it as spam.
            >
            I don't think it's the return path that's triggering the spam filters,
            because it still gets marked as spam if From is set to be the same as
            the server mentioned in the return path. I've emailed our IT
            department about the filtering used, but they've not gotten back to
            me, and they're not much help when it comes to problems that can't be
            solved by turning it off and on again.

            Comment

            Working...