3

Possible Duplicate:
how to avoid email header Received: from unknown and email going to spam

I try to send email from our server using php and Zend_Mail. I use smtp transport. This is confirmation email of subscribing on my site. But for some reason email that I send has strange headers and email goes to spam folder:

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

smtp1.searchboxindustries.com should resolve to 207.162.215.30. Why do I have this header then?

What does it mean list header "Recieved: from uknown"? Can it make email go to spam? How to avoid this strange header and make email avoid spam folder? Maybe I have some problems with DNS settings of this domain?

Spf seems ok:

Received-SPF: pass 

Code for setting headers:

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

$mailer->addHeader('Sender', $params['list_email'] . '.emailname.com');                     
$mailer->setReturnPath($params['list_email'] . '.emailname.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  = emailname.com
email.server = emailserver.com
email.username = email@address.com
email.password = password
email.auth = plain
email.port = 999
email.from_address = "address@email.com"
email.from_name = "Mailable";
Community
  • 1
  • 1
Oleg
  • 2,733
  • 7
  • 39
  • 62

2 Answers2

0

Have you tried to remove the following line? This seems duplicate to ->setFrom (see http://framework.zend.com/manual/1.12/en/zend.mail.introduction.html#zend.mail.introduction.sendmail)

$mailer->addHeader('Sender', $params['list_email'] . '.exampledomain.com');
teamcrisis
  • 709
  • 1
  • 6
  • 14
Zeal
  • 239
  • 1
  • 3
0

From the information you've given, the domain of the sender in 'from' part is not the domain that is registered from the IP you're connecting from.

It's a typical pattern for spam to be sent from hosts without registered domain name, or impersonating other domain, so such mail will usually be marked as spam.

If you want your post to be delivered to gmail and not marked as spam, send the mail using gmail or other e-mail provider, not your local SMTP. Note that too many mails sent from one accout could made it be marked as spammer. For mass correspondence you'll need probably to register your own domain.

Danubian Sailor
  • 1
  • 38
  • 145
  • 223
  • exampledomain.com from config is your domain? – Danubian Sailor Jan 10 '13 at 15:03
  • No, I simply change my domain for example.domain in post, but I post for real domain. And I use email authentication SPF and it looks like it passes. – Oleg Jan 10 '13 at 15:04
  • Could you answer the question what's the problem and how to fix it? – Oleg Jan 10 '13 at 15:09
  • I've said, it looks as your IP or domain is suspicious for gmail. But it's hard to say if you don't post your REAL configuration – Danubian Sailor Jan 10 '13 at 15:20
  • IP and domain is ok. I checked them, they're not blacklisted or so. – Oleg Jan 10 '13 at 15:21
  • Domain if ok , do you know how to solve the issue? I don't understand what you mean that IP or domain is suspicious for gmail. Why did you decide so? – Oleg Jan 10 '13 at 15:23
  • It's the gmail that generates that header, but it usually means that the mail was received from sender, whose IP couldn't be resolved to domain name, and that sender has presented itself as exampledomain.com – Danubian Sailor Jan 10 '13 at 15:30
  • 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 – Oleg Jan 15 '13 at 04:52
  • smtp1.searchboxindusties resolves to 207.162.215.30, right? What's problem then? – Oleg Jan 15 '13 at 04:53
  • I edited question to reflect new headers. – Oleg Jan 15 '13 at 05:09