1

I have mail() function that sends email and seems to me the problem is not in the mail headers but stil I got 2 positions in the mail SPAM assignation that makes some email providers to classify my emails as spam. This is :

0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
                         blocked.  See
                         http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
                          for more information.
                         [URIs: shoppingbulgaria.com]
  0.8 BAYES_50               BODY: Bayes spam probability is 40 to 60%
                         [score: 0.5000]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
  0.1 MIME_HTML_ONLY         BODY: Message only has text/html MIME parts
  0.0 HTML_FONT_LOW_CONTRAST BODY: HTML font color similar or
                         identical to background
  0.0 HTML_MESSAGE           BODY: HTML included in message
  0.0 HTML_IMAGE_ONLY_32     BODY: HTML: images with 2800-3200 bytes of
                         words
  0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
                         valid
 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from
                         envelope-from domain
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
                         author's domain
 -0.1 DKIM_VALID             Message has at least one valid DKIM or DK signature
  2.5 PHP_SCRIPT             Sent by PHP script
  2.2 HAS_X_OUTGOING_SPAM_STAT Has header claiming outbound spam scan
                         - why trust the results?

As you can see last 2 positions make the difference of being marked as SPAM or not:

2.5 PHP_SCRIPT             Sent by PHP script
2.2 HAS_X_OUTGOING_SPAM_STAT

Unfortunately I could not find any information and explanation for this:

2.5 PHP_SCRIPT             Sent by PHP script

Why the fact its been sent by php script could be a reason for being marked as SPAM? And what this means:

2.2 HAS_X_OUTGOING_SPAM_STAT Has header claiming outbound spam scan
                     - why trust the results?

$headers ='';
if(isset($p['from_name'])) $headers .= "From: ".official_site_name." <".$p['from_email'].">\r\n";
if(isset($p['from_email'])) $headers .= "Reply-To: ".official_site_name." <".strip_tags($p['from_email']).">\r\n";
else $headers .= "Reply-To: ".official_site_name." <".official_mail_sender.">\r\n";
$headers .= "Return-Path: <".official_mail_sender.">\r\n";
if(!empty($p['cc'])) $headers .= "CC: <".strip_tags($p['cc']).">\r\n";
if(!empty($p['bcc'])) $headers .= "BCC: <".strip_tags($p['bcc']).">\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$headers .= "Content-Transfer-Encoding: 8bit\r\n";
$headers .= "X-Mailer: PHP/". phpversion() ."\r\n" ;
$headers .= "MIME-Version: 1.0\r\n";
$random_hash = md5(date('r'));
$body='<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>'.$p['subject'].'</title>
</head>
<body bgcolor="White">Body text</body></html>';

mail("<".$p['to'].">", '=?utf-8?B?'.base64_encode(strip_tags($p['subject'])).'?=', $body, $headers, "-f ".official_mail_sender."");

The body has normal registration welcome text..

Thanks for any help

Europeuser
  • 934
  • 1
  • 9
  • 32
  • Post your code for sending emails. For instance you maybe sending something like `'X-Mailer: PHP/' . phpversion();` in the headers... – cOle2 Mar 17 '21 at 18:38
  • #cOle2 - yes I have but even when remove it - the same.. Mail code added – Europeuser Mar 18 '21 at 04:55
  • The linked answers don't seem to address the entry in question: "2.5 PHP_SCRIPT Sent by PHP script". – showdev Apr 02 '21 at 00:26

0 Answers0