6

I try to send email from our server using php and Zend_Mail. I use smtp transport. This is confimation email of subscribing. But for some reason email that I send has strange headers and email goes to spam folder (I see them in gmail that receive letter):

 Message-Id: <50ee94f7.84fc440a.62dc.ffff9685SMTPIN_ADDED_MISSING@mx.google.com>
    Received: (qmail 10943 invoked from network); 10 Jan 2013 10:16:22 -0000
    Received: from unknown (HELO searchboxindustries.com)  (username@searchboxindustries.com@207.162.215.30)

What does it mean list header "Recieved: from unknown"? Can it make email go to spam? How to avoid this strange header and make email avoid spam folder? Is there any problem with coode or maybe I have some problems with DNS settings of this domain?

Here's code for setting headers:

$mailer->setFrom($params['list_email'], $params['list_from_name']);
$mailer->setReplyTo($params['list_email']);

$mailer->addHeader('Sender', $params['list_email'] . '.searchboxindustries.com');                       
$mailer->setReturnPath($params['list_email'] . '.searchboxindustries.com');         

$mailer->addTo($params['email_address']);

Code to configure transport:

$emailConfig = $this->getOption('email');                                   
        $transport = new Zend_Mail_Transport_Smtp($emailConfig['server'], $emailConfig);
Zend_Mail::setDefaultTransport($transport);

Email config from application.ini:

   email.name  = searchboxindustries.com
   email.server = searchboxindustries.com
   email.username = user_name
   email.password = password
   email.auth = plain
   email.port = 587

Here are headers of such email:

Delivered-To: gala19612009@gmail.com
Received: by 10.76.94.204 with SMTP id de12csp111150oab;
        Fri, 11 Jan 2013 01:58:49 -0800 (PST)
X-Received: by 10.69.0.8 with SMTP id au8mr228881813pbd.58.1357898329423;
        Fri, 11 Jan 2013 01:58:49 -0800 (PST)
Return-Path: <opp@mail15.com.searchboxindustries.com>
Received: from smtp1-1.searchboxindustries.com (mta1.searchboxindustries.com. [207.162.215.30])
        by mx.google.com with SMTP id d7si4727205paw.95.2013.01.11.01.58.48;
        Fri, 11 Jan 2013 01:58:48 -0800 (PST)
Received-SPF: pass (google.com: domain of opp@mail15.com.searchboxindustries.com designates 207.162.215.30 as permitted sender) client-ip=207.162.215.30;
Authentication-Results: mx.google.com;
       spf=pass (google.com: domain of opp@mail15.com.searchboxindustries.com designates 207.162.215.30 as permitted sender) smtp.mail=opp@mail15.com.searchboxindustries.com
Message-Id: <50efe258.a74b420a.3351.12fcSMTPIN_ADDED_MISSING@mx.google.com>
Received: (qmail 21583 invoked from network); 11 Jan 2013 09:58:48 -0000
Received: from unknown (HELO searchboxindustries.com) (username@searchboxindustries.com@207.162.215.30)
  by searchboxindustries.com with SMTP; 11 Jan 2013 09:58:48 -0000
From: Oleg <opp@mail15.com>
Reply-To: opp@mail15.com
Sender: opp@mail15.com.searchboxindustries.com
Return-Path: opp@mail15.com.searchboxindustries.com
To: gala19612009@gmail.com
Subject: List1: Confirm Subscription
Date: Fri, 11 Jan 2013 04:58:48 -0500
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
MIME-Version: 1.0

Spf seems to be ok. The ip from which email is sent is not blacklisted.

Now there are changes in DNS and I have headers:

Message-Id: <50f41c80.67e3440a.2d32.6aabSMTPIN_ADDED_MISSING@mx.google.com>
Received: (qmail 18457 invoked from network); 14 Jan 2013 14:55:59 -0000
Received: from unknown (HELO smtp1-1.searchboxindustries.com) (username@searchboxindustries.com@207.162.215.30)
  by searchboxindustries.com with SMTP; 14 Jan 2013 14:55:59 -0000

We have Reverse DNS set. 207.162.215.30 is resolved to stmp1.searchboxindustries.com. What's the problem then? I wonder what is strange format in brackets in the header Received : from unknow:

 username@searchboxindustries.com@207.162.215.30
4

3 回答 3

3

Received: from unknown只是意味着一个 SMTP 服务器从另一个不提供反向 DNS 的 SMTP 服务器接收它。通常,从一个 SMTP 服务器到另一个 SMTP 服务器的每个跃点都会Received:在消息顶部添加一个标头(除了qmail,它添加了两个;这在您的示例中可见)。

如果您担心缺少反向 DNS,并且如果 207.162.215.30 是您的,那么也许您可以说服您的 ISP 为其提供反向 DNS。许多 ISP 拒绝(如果您使用“消费者”宽带计划),或者需要与您签订不同的托管合同才能提供此服务。(“反向 DNS”意味着当有人向 DNS 查询“207.162.215.30 的 DNS 名称是什么”时,答案将是“searchboxindustries.com”或其他主机名,但不是“未知”。)

反向 DNS 查找通常基于 TCP 标头而不是消息文本执行。如果 SMTP 服务器接收到来自 123.45.67.89 的连接,那么它将对该地址执行反向 DNS,并将结果放在Received:它添加的标头中。换句话说,您的邮件标头或信封标头的内容根本不会影响此结果。

收件人可以对这些标头做任何他们想做的事情。仅此标头(此标头的存在,或从其内容中没有明显的反向 DNS 信息)不太可能足以让某人将您的邮件分类为垃圾邮件,但实际上没有办法控制收件人使用此信息。

如果有的话,您的问题表明您可能应该寻求专业服务来代表您发送这些消息,但需要付费。

于 2013-01-15T12:46:13.037 回答
0

我的服务器需要额外的 (php.)ini 设置,这可以解决您的问题吗?

ini_set('sendmail_from', 'enterAValidEmailAddr@yourDomainHere');
于 2013-01-11T11:15:31.543 回答
0

尝试以下选项以找出问题所在:

  1. 电子邮件有正文吗?我相信有电子邮件正文。
  2. 为了隔离问题,您可以尝试使用另一种替代 SMTP(例如:gmail smtp)。
  3. 或者,您可以不使用 smtp 直接使用 PHP 邮件。
于 2013-01-11T10:14:56.807 回答