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) ([email protected]@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: [email protected]
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: <[email protected]>
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 [email protected] 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 [email protected] designates 207.162.215.30 as permitted sender) [email protected]
Message-Id: <[email protected]>
Received: (qmail 21583 invoked from network); 11 Jan 2013 09:58:48 -0000
Received: from unknown (HELO searchboxindustries.com) ([email protected]@207.162.215.30)
by searchboxindustries.com with SMTP; 11 Jan 2013 09:58:48 -0000
From: Oleg <[email protected]>
Reply-To: [email protected]
Sender: [email protected]
Return-Path: [email protected]
To: [email protected]
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: <[email protected]>
Received: (qmail 18457 invoked from network); 14 Jan 2013 14:55:59 -0000
Received: from unknown (HELO smtp1-1.searchboxindustries.com) ([email protected]@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:
[email protected]@207.162.215.30
unknown
, I've found that this happens, when receiving end can not check your smtp-server IP using reverse DNS: either it can't extract IP from "([email protected]@207.162.215.30)", or may be it founds that reverse DNS-ed domain "mta1.searchboxindustries.com" is not equal to "searchboxindustries.com". I'm not sure about that. – Evieevilreturn-path
equal tofrom
and removesender
. – Evieevil