Auto generated emails go to spam

Zagorax

Verified User
Joined
Jan 11, 2011
Messages
67
[SOLVED]Auto generated emails go to spam

Hi,

I've googled about this problem and I found that it's a reverse dns problem. If I do:
Code:
nslookup 158.58.168.96
I get:
Code:
Server:		131.114.21.25
Address:	131.114.21.25#53

Non-authoritative answer:
96.168.58.158.in-addr.arpa	name = fs1.francescoruvolo.com.

Authoritative answers can be found from:
168.58.158.in-addr.arpa	nameserver = ns2.seflow.net.
168.58.158.in-addr.arpa	nameserver = ns1.seflow.net.
ns1.seflow.net	internet address = 158.58.169.5
ns1.seflow.net	has AAAA address 2a02:29e0:2:4::84a7:c90
ns2.seflow.net	internet address = 158.58.169.6
ns2.seflow.net	has AAAA address 2a02:29e0:2:4::8e71:6dc8

So, the name of my server is listed under "Non-authoritative answer". Is it the reason why every auto generated email (for example on new account creation or update available) is marked as spam by google? Of course, I can use a filter to fix it, but I can't ask every customer to do the same.
 
Last edited:
So, the name of my server is listed under "Non-authoritative answer". Is it the reason why every auto generated email (for example on new account creation or update available) is marked as spam by google? Of course, I can use a filter to fix it, but I can't ask every customer to do the same.

No, if you ask with nslookup an authoritative NS server:

Authoritative answers can be found from:
168.58.158.in-addr.arpa nameserver = ns2.seflow.net.
168.58.158.in-addr.arpa nameserver = ns1.seflow.net.
ns1.seflow.net internet address = 158.58.169.5
ns1.seflow.net has AAAA address 2a02:29e0:2:4::84a7:c90
ns2.seflow.net internet address = 158.58.169.6
ns2.seflow.net has AAAA address 2a02:29e0:2:4::8e71:6dc8

then you won't see "Non-authoritative answer" line.

To learn the reasons on why your auto generated emails go to spam, you need to study exim logs (as google replies sometimes with hints) and check headers of such emails, they should contain all necessary and valid data.
 
To learn the reasons on why your auto generated emails go to spam, you need to study exim logs (as google replies sometimes with hints) and check headers of such emails, they should contain all necessary and valid data.

Checking the header I found this line:

Authentication-Results: mx.google.com;
spf=softfail (google.com: domain of transitioning [email protected] does not designate 2a02:29e0:2:4::b5b6:f0bd as permitted sender) [email protected]

Looking for a solution online I found that it could be a dns related problem: http://support.google.com/a/bin/answer.py?hl=en&answer=178723.

By now, the only txt record that all of my domains have is: "v=spf1 a mx ip4:158.58.168.96 ~all"

So, is it enough to create that dns record for the domain francescoruvolo.com which is the one which sends the email? Or I should add that record for all domains?

Cheers
 
Last edited:
You should add IPv6 2a02:29e0:2:4::b5b6:f0bd as well to the record.

Ok, I've add this line in the template file for dns_txt. How do I rewrite dns settings for all domains?

Is there any documentation about all the command we can supply to task.queue? I cannot find it.

Cheers
 
Code:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d400

Also make sure your code you changed for dns_txt is in /usr/local/directadmin/data/templates/custom and not just data/templates or it will get overwritten during the next update.

The only place there is documentation is:

http://help.directadmin.com
http://directadmin.com/versions.php
 
Code:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d400

That was actually the only thing I'd tried (it seemed the right thing to do :) ). I got a lot of:

Code:
File /var/named/DOMAIN.db.temp appears ok to named-checkzone

One per each domain but still the txt record contains only ip4 and not ip6 directive. Here is the content of /usr/local/directadmin/data/templates/custom/dns_txt.conf:

Code:
|DOMAIN|.="v=spf1 a mx ip4:|SERVER_IP| ip6:2a02:29e0:2:4::b5b6:f0bd ~all"

And these are permission on that file:

Code:
-rw-r--r-- 1 diradmin diradmin 74 May 23 15:17 dns_txt.conf

Which seems ok to me, since these are the same permission I've on other custom templates that work.
 
Ok, I've add this line in the template file for dns_txt. How do I rewrite dns settings for all domains?

Is there any documentation about all the command we can supply to task.queue? I cannot find it.

I doubt you can do it with task.queue, unless you want to reset all zones to defaults.

Check this

- http://help.directadmin.com/item.php?id=141 (How to use perl to do a mass dns update)
- http://help.directadmin.com/item.php?id=285 (How to add a new dns record to all existing domains and pointer zones)
 
Code:
perl -pi -e 's/v=spf1 a mx ip4:158.58.168.96 ~all/v=spf1 a mx ip4:158.58.168.96 ip6:2a02:29e0:2:4::b5b6:f0bd ~all/g' /var/named/*.db
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d400
 
Actually it was solved, but now emails are again sent to spam. :(
Here are the header:

Authentication-Results: mx.google.com;
spf=pass (google.com: domain of [email protected] designates 2a02:29e0:2:4::b5b6:f0bd as permitted sender) [email protected];
dmarc=fail (p=NONE dis=NONE) d=gmail.com

As you can see, there's a new dmarc test which fails. Searching on google I've found this page (http://support.google.com/a/bin/answer.py?hl=en&answer=2466580), which says:

"A message must fail both SPF and DKIM checks to also fail DMARC."

But SPF test is marked as "pass" in my case.
 
Ok, so I've added the ip6: directive to the template, issued a rewrite, but nothing has changed?

I didn't use chatwzrd's perl solution as when it rewrites, it will overwrite the zones again.

Turns out you do need to manually edit the zone files.... I thought the named rewrite rewrote everything, clearly it doesn't
 
Last edited:
Back
Top