Can I use include and redirect in same SPF record?

rahoolm asked:

My current SPF record is as below

Host                  Value                                   TTL
myexampledomain.com   "v=spf1 redirect=_spf.mailhostbox.com" 1 Day  

I am using 2 free email offered by the hosting provider. Now I have got a VPS where I have created email server. The thing is I want to create new email addresses for my domain and add a proper SPF and DKIM record.

I tried to use include:myexampledomain.com mx a in the SPF record, but then everything stopped working, even the 2 free emails.

Is it right to use include as well as redirect in same SPF record?
Or would like to know what should be the right way to do this? I do not want my email should land up in spam / junk mails. Also, if this is impossible is it possible to use Gmail to Send Email as mynewemail@myexampledomain.com?

I am quite confused, read many articles but was not able to get the answer.
Other settings are as below
MX records

Priority    Host                MX Entry                    TTL
100     myexampledomain.com.    us2.mx3.mailhostbox.com.    1 day
100     myexampledomain.com.    us2.mx1.mailhostbox.com.    1 day
100     myexampledomain.com.    us2.mx2.mailhostbox.com.    1 day

CNAME records

Alias Host                      Canonical Host                  TTL
webmail.myexampledomain.com.    us2.webmail.mailhostbox.com.    1 day
smtp.myexampledomain.com.       us2.smtp.mailhostbox.com.       1 day
imap.myexampledomain.com.       us2.imap.mailhostbox.com.       1 day
pop.myexampledomain.com.        us2.pop.mailhostbox.com.        1 day 

My answer:


Per RFC 7208:

You can use any mechanism with redirect except for the all mechanism.

Note that it doesn’t make much sense to use redirect unless you are redirecting to records for a domain that is also under your control. If a third party asks you to do this, beat them over the head with a copy of the RFC; they should generally be asking you to include instead.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.