Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Oct 11, 2014 5:12 am 
Offline
Senior Newbie

Joined: Sat Oct 11, 2014 5:07 am
Posts: 8
I am using php mail function to send an email, and it keeps going to google spam folder.

I sent an email to http://www.mail-tester.com and I see the problem:

This is what it says:

From : info@appstoreranktracker.com
Bounce address : www-data@beastmode
Reply-To : info@appstoreranktracker.com

[SPF] beastmode does not allow your server 173.255.253.72 to use www-data@beastmode
We check if there is a mail server (A Record) behind your hostname beastmode.
You may want to publish a DNS record (A type) for the hostname beastmode or use a different hostname in your mail software.

Why is my bounce address www-data@beastmode andd not info@appstoreranktracker.com?

Anyone know how to fix this?

These are the headers I am using with the php mail:

$header = 'From: info@appstoreranktracker.com' . "\r\n" .
'Reply-To: info@appstoreranktracker.com' . "\r\n" .
'Return-Path: info@appstoreranktracker.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();


Top
   
PostPosted: Sat Oct 11, 2014 6:37 am 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
Is your Linode's hostname 'beastmode'?

The name 'beastmode' probably appears somewhere in your email server's config. What email server software are you using (postfix, courier, exim, sendmail, etc)?


Top
   
PostPosted: Sat Oct 11, 2014 6:44 am 
Offline
Senior Newbie

Joined: Sat Oct 11, 2014 5:07 am
Posts: 8
Yes, my linode hostname is: beastmode

I am using Sendmail, the php mail function.


Top
   
PostPosted: Sat Oct 11, 2014 7:01 am 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
Your configuration is using 'www-data' (your apache user name) @ 'beastmode' (your hostname) as the bounce address.

When using the PHP mail() function you should add the envelope sender as the last parameter (don't forget the -f flag):
Code:
mail('nobody@example.com', 'the subject', 'the message', $header, '-f info@appstoreranktracker.com'); 


Top
   
PostPosted: Sat Oct 11, 2014 7:11 am 
Offline
Senior Newbie

Joined: Sat Oct 11, 2014 5:07 am
Posts: 8
That worked to solve the strange bounce address, although I am still getting flagged for spam because of a missing mx record:

http://www.mail-tester.com/web-A1EU26

We didn't find a mail server (A Record) behind your hostname beastmode.
We check if there is a mail server (A Record) behind your hostname beastmode.
You may want to publish a DNS record (A type) for the hostname beastmode or use a different hostname in your mail software.

How do I add that mx record? I know how to do it through linode, but what exactly am I suppose to add?


Top
   
PostPosted: Sat Oct 11, 2014 7:20 am 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
You have two choices:
- add an a record for beastmode.appstoreranktracker.com
- research how to change your email config

Verify what email software you are using on your Linode (just because you're using mail() doesn't mean you're using sendmail). What do you get when you run the following command:
Code:
netstat -tulpn | grep ":25"


Top
   
PostPosted: Sat Oct 11, 2014 7:25 am 
Offline
Senior Newbie

Joined: Sat Oct 11, 2014 5:07 am
Posts: 8
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 13421/sendmail: MTA

Looks like sendmail.

Should I change the config, if so what should I change? I just added an a record, now my a records are the following:

beastmode 173.255.253.72 Default
mail 173.255.253.72 Default
www 173.255.253.72 Default

Is that right?


Top
   
PostPosted: Sat Oct 11, 2014 7:43 am 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
I would research changing sendmail hostname


Top
   
PostPosted: Sat Oct 11, 2014 7:50 am 
Offline
Senior Newbie

Joined: Sat Oct 11, 2014 5:07 am
Posts: 8
What should I change it to? my domain name?


Top
   
PostPosted: Sat Oct 11, 2014 7:53 am 
Offline
Senior Newbie

Joined: Sat Oct 11, 2014 5:07 am
Posts: 8
Got it, this is what I need to add to my sendmail config

define(`confDOMAIN_NAME', `mail.yourdomain.com')dnl


Top
   
PostPosted: Sat Oct 11, 2014 8:05 am 
Offline
Senior Newbie

Joined: Sat Oct 11, 2014 5:07 am
Posts: 8
Well, it worked, but my email still goes to spam, even though I have a 9/10 rating with mail-checker.com

http://www.mail-tester.com/web-Tw0wT2

I have everything working except DKIM but I am almost positive that is not required to reach inbox for google.

I have not been able to get a linode to reach google inbox, what am I doing wrong? Have you been able to get sendmail to reach inbox using sendmail?

<?php
$to = "dcman99@gmail.com";
$subject = "How are you?";
$message = "Did you get this email? This is a test from the new server setup.";
$header = 'From: info@appstoreranktracker.com' . "\r\n" .
'Reply-To: info@appstoreranktracker.com' . "\r\n" .
'Return-Path: info@appstoreranktracker.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$retval = mail ($to,$subject,$message,$header, '-f info@appstoreranktracker.com');
if( $retval == true )
{
echo "Message sent successfully...";
}
else
{
echo "Message could not be sent...";
}
?>


Last edited by blazo on Sat Oct 11, 2014 9:09 am, edited 1 time in total.

Top
   
PostPosted: Sat Oct 11, 2014 8:07 am 
Offline
Senior Newbie

Joined: Sat Oct 11, 2014 5:07 am
Posts: 8
Ahh it may be Reverse DNS, I just enabled it but it says it will take 24 hours to take effect.

Reverse DNS lookup or reverse DNS resolution (rDNS) is the determination of a domain name that is associated with a given IP address.
Some companies such as AOL will reject any message sent from a server without rDNS, so you must ensure that you have one.
You cannot associate more than one domain name with a single IP address.

Your IP address 173.255.253.72 is associated with the domain li263-72.members.linode.com.
Nevertheless your message appears to be sent from mail.appstoreranktracker.com.

You may want to change your pointer (PTR type) DNS record and the host name of your server to the same value.

Here are the tested values for this check:

IP: 173.255.253.72
HELO: mail.appstoreranktracker.com
rDNS: li263-72.members.linode.com


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group