LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-17-2016, 03:20 PM   #1
danjde
Member
 
Registered: Jun 2014
Posts: 36

Rep: Reputation: Disabled
Question Correct SPF record for email server


Hi friends,

I'm building a Postfix/Dovecot email server on Debian jessie on my VPS,
and I would like to add its correct DNS record.

Considering that the FQDN is: "server.mydomain.org"

and the other DNS entry:

MX: "server.mydomain.org"
CNAME: "(mail).mydomain.org"
CNAME: "(smtp).mydomain.org"
CNAME: "(pop).mydomain.org"


I would like to understand if the SPF value, given to me by my DNS maintainer (that differ from the VPS maintainer) is correct:

name: server
value: v=spf1 include:_spf.th.seeweb.it

but instead if I check from SPF Wizard it suggest me this SPF record instead (the IP address is random):

v=spf1 mx a:server.mydomain.org ip4:90.123.123.90 ~all

At this point I have two different information and do not know which one to use.... :-)

which of the two should I use?

many thanks!
 
Old 09-17-2016, 07:57 PM   #2
af7567
Member
 
Registered: Nov 2012
Posts: 293

Rep: Reputation: 106Reputation: 106
Without knowing what your real email domain or MX addresses are no one can guess what the proper SPF record should be. It also depends if your VPS sends mail directly or through a relay. Since the mail is sent from the VPS, I would guess the SPF record given by the VPS provider would be most accurate.
 
Old 09-18-2016, 09:48 AM   #3
danjde
Member
 
Registered: Jun 2014
Posts: 36

Original Poster
Rep: Reputation: Disabled
Quote:
af7567: Without knowing what your real email domain or MX addresses are no one can guess what the proper SPF record should be.
..but if they were the ones mentioned in this post?

Quote:
af7567: It also depends if your VPS sends mail directly or through a relay. Since the mail is sent from the VPS, I would guess the SPF record given by the VPS provider would be most accurate.
Yes, my VPS sends mail directly.
But as you can see above, the SPF record is not given by VPS provider but by the domain provider (that is different) and he doesn't know the VPS ip or its FQDN...

Many many thanks for your help!
 
Old 09-18-2016, 01:06 PM   #4
af7567
Member
 
Registered: Nov 2012
Posts: 293

Rep: Reputation: 106Reputation: 106
Quote:
Originally Posted by danjde View Post
..but if they were the ones mentioned in this post?

Yes, my VPS sends mail directly.
But as you can see above, the SPF record is not given by VPS provider but by the domain provider (that is different) and he doesn't know the VPS ip or its FQDN...

Many many thanks for your help!
Ah sorry, I thought you meant your VPS provider had given you a different SPF record. When you say the IP address 90.123.123.90 is random do you mean that you changed it for this post or that the SPF wizard created it?

Assuming that 90.123.123.90 is the public IP of your VPS and server.mydomain.org is the hostname (and also the MX record) then you just need "v=spf1 a:server.mydomain.org ~all"

include:_spf.th.seeweb.it is only needed if you are using "seeweb.it" mail server as your relay, but since you send mail directly from the VPS you only need the hostname or IP address of your VPS. Since "server.mydomain.org" resolves to the VPS IP address you don't need to include ip4: in the SPF record. Also, since the MX is also server.mydomain.org you don't need to include "mx" either in the SPF record.

Note. the ~all is a soft fail which means if mail comes from a different server to your VPS then it will still be accepted but marked as a fail. After you have tested your SPF record for a while and are sure there are no problems you could change this ~all to -all which will reject mail that is not from your VPS.

Last edited by af7567; 09-18-2016 at 01:13 PM.
 
Old 09-19-2016, 01:49 AM   #5
danjde
Member
 
Registered: Jun 2014
Posts: 36

Original Poster
Rep: Reputation: Disabled
WOW! Very clear explanation!
You have clarified all doubts I had left about SPF record!

Very very thanks for your really really useful help! ;-)

ciao!
 
  


Reply

Tags
dns, record, spf



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mutt, sendmail, hostname and correct SPF record matching kevpatts Linux - Server 6 04-08-2015 08:21 AM
SPF record on a relayed email depam Linux - Security 1 05-22-2014 08:29 AM
Spf record pprabhul071 Linux - Newbie 1 04-01-2014 02:57 PM
hosting server SPF TXT record setup kitek Linux - Server 2 06-17-2012 07:30 AM
SPF record macadam Linux - Security 4 05-03-2005 08:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration