By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,889 Members | 1,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,889 IT Pros & Developers. It's quick & easy.

PHP mail being marked as spam

P: n/a
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>Untitled 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">Subject</label>
<input type="text" name="subj" id="subj" />
</p>
<p>
<label for="msg">Message</label>
<textarea name="msg" cols="60" rows="8" id="msg"></textarea>
</p>
<p>
<label for="Submit">Submit</label>
<input type="submit" name="Submit" value="Submit" id="Submit" />
</p>
</form>
</body>
</html>
<?php
$headers = 'From: cm*@cms.merus.co.uk
Return-Path: cm*@cms.merus.co.uk
Reply-To: cm*@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.
Sep 1 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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>Untitled 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">Subject</label>
<input type="text" name="subj" id="subj" />
</p>
<p>
<label for="msg">Message</label>
<textarea name="msg" cols="60" rows="8" id="msg"></textarea>
</p>
<p>
<label for="Submit">Submit</label>
<input type="submit" name="Submit" value="Submit" id="Submit" />
</p>
</form>
</body>
</html>
<?php
$headers = 'From: cm*@cms.merus.co.uk
Return-Path: cm*@cms.merus.co.uk
Reply-To: cm*@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.
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.
js*******@attglobal.net
==================

Sep 1 '08 #2

P: n/a
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" <go**********@ntlworld.comwrote in message
news:32**********************************@m73g2000 hsh.googlegroups.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>Untitled 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">Subject</label>
<input type="text" name="subj" id="subj" />
</p>
<p>
<label for="msg">Message</label>
<textarea name="msg" cols="60" rows="8" id="msg"></textarea>
</p>
<p>
<label for="Submit">Submit</label>
<input type="submit" name="Submit" value="Submit" id="Submit" />
</p>
</form>
</body>
</html>
<?php
$headers = 'From: cm*@cms.merus.co.uk
Return-Path: cm*@cms.merus.co.uk
Reply-To: cm*@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.

Sep 1 '08 #3

P: n/a
Michael Vilain wrote:
In article
<32**********************************@m73g2000hsh. googlegroups.com>,
Gordon <go**********@ntlworld.comwrote:
>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>Untitled 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">Subject</label>
<input type="text" name="subj" id="subj" />
</p>
<p>
<label for="msg">Message</label>
<textarea name="msg" cols="60" rows="8" id="msg"></textarea>
</p>
<p>
<label for="Submit">Submit</label>
<input type="submit" name="Submit" value="Submit" id="Submit" />
</p>
</form>
</body>
</html>
<?php
$headers = 'From: cm*@cms.merus.co.uk
Return-Path: cm*@cms.merus.co.uk
Reply-To: cm*@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.

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:

http://www.senderbase.org/senderbase...h_string=62.12
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.
js*******@attglobal.net
==================

Sep 2 '08 #4

P: n/a
On Sep 1, 3:46 pm, "Joe Butler" <ffffh.no.s...@hotmail-spammers-
paradise.comwrote:
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...@ntlworld.comwrote in message

news:32**********************************@m73g2000 hsh.googlegroups.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>Untitled 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">Subject</label>
<input type="text" name="subj" id="subj" />
</p>
<p>
<label for="msg">Message</label>
<textarea name="msg" cols="60" rows="8" id="msg"></textarea>
</p>
<p>
<label for="Submit">Submit</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.
Sep 2 '08 #5

P: n/a
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 ra****@otherserver-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" <go**********@ntlworld.comwrote in message
news:62**********************************@y21g2000 hsf.googlegroups.com...
On Sep 1, 3:46 pm, "Joe Butler" <ffffh.no.s...@hotmail-spammers-
paradise.comwrote:
>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...@ntlworld.comwrote in message

news:32**********************************@m73g200 0hsh.googlegroups.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>Untitled 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">Subject</label>
<input type="text" name="subj" id="subj" />
</p>
<p>
<label for="msg">Message</label>
<textarea name="msg" cols="60" rows="8" id="msg"></textarea>
</p>
<p>
<label for="Submit">Submit</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.

Sep 2 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.