Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am configuring my linode server to send mail from my webapp to users. I could use GoogleApps, but the 500/day limit it too restrictive, hence I'm attempting to set it up myself.

I set up Exim4 on my server using these instructions provided by linode. All good. I tested sending an email to my gmail/yahoo using this command on the server:

$ echo "This is a test from myapp." | mail -s Testing

I do receive the email in my Gmail inbox (not marked as spam), and also in my Ymail (marked as spam). Wanting to not be marked as spam, I inspected the header of the email that was sent.

I see these lines (me obfuscating with XXX) in the gmail header:

Received-SPF: neutral ( 69.XXX.XXX.XXX is neither permitted nor denied by best guess record for domain of client-ip=69.XXX.XXX.XXX;
Authentication-Results:; spf=neutral ( 69.XXX.XXX.XXX is neither permitted nor denied by best guess record for domain of

This is the header of the email that Yahoo receives:

Received-SPF: none ( domain of does not designate permitted sender hosts)

So it seems like the SPF record was not set (which it wasn't). Since I own the domain, I went to insert this SPF text into my records:

To be exact, I set
1) the subdomain to an A record pointing to my IP.
2) a TXT record for "@" as "v=spf1 ip4:69.XXX.XXX.XXX a ~all"

This seems like all I should have to do appropriately set the ips/domain names as a SPF record. However, when testing gmail/yahoo again it continues to give me the same "Neutral" status on Gmail, and spam status on Yahoo.

I am suspecting that the Google Gmail / Yahoo Ymail servers must be caching my DNS information on their end, and I'll continue to get this "neutral/spam" status until the DNS entry is flushed from their cache. Does anyone know if they do cache this info, and how long it typically takes before the SPF information is picked up? Anything else I might have done wrong or should check?

share|improve this question
up vote 1 down vote accepted

If I'm following your setup correctly you have your SPF record set on the root, but you are sending email from the sub-domain

if the 'envelope from' of the email is then you need to change the "@" txt record to "mail". if you were sending mail from then your setup would be correct.

So something like this

;;in the zone
@    IN   TXT  "v=spf1 ip4:69.XXX.XXX.XXX ~all" ;covers
mail IN   A
mail IN   TXT  "v=spf1 ip4:69.XXX.XXX.XXX ~all" ;covers
share|improve this answer
I believe this was indeed my problem. I changed the TXT record to apply to "main", so it matches a sender like "". After making the change, I waited about 30minutes before the "Received-SPF: pass" appeared in emails sent to both Gmail and Ymail. Interesting side note: this still isn't enough to mark emails as non-spam for Ymail. So I'm going to try setting DKIM sigs next. – sghael Jul 12 '10 at 21:16

These records are subject to the same kind of TTL as regular A records. The TTL value informs other DNS servers how long it is safe to cache the record. Yours is set to 300 seconds (5 minutes). Some mailers/DNS-servers ignore TTL values below a certain limit though, so it can be hard to be 100% sure when a change has propagated.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.