0

I'm trying to set up Postfix in Ubuntu Server 20.04 as an email sender (I don't need to receive emails) in my subdomain server.

I have the main domain that works with one server, and a subdomain that works with another server (with a different public IP). To better understand, this is the DNS setup:

- mydomain.com, (type) A, IP 185.xx.xxx.xxx
- subdom.mydomain.com, (type) A, IP 87.xx.xx.xxx (this is an home server)

I'm trying to configure the SPF on my DynamicDNS provider panel like this (DNS name are resolved by a DDNS provider):

- subdom.mydomain.com, (type) TXT, IP 87.xx.xx.xxx, v=spf1 a include:subdom.mydomain.com -all

I already configured SSL certificate for subdom.mydomain.com, but every email that I send will be received in the spam folder with error:

"spf=neutral google.com: 87.xx.xx.xxx is neither permitted nor denied by best guess record for domain of [email protected]"

How can I fix my SPF to avoid that all email will be marked as spam?

Thank you

1 Answer 1

0

Add ip4:1.2.3.0/CIDR and ~all in spf record can solve issue. But this is not good because someone who has that ip range can send mail will be authenticated.

8
  • Thank you for your answer. I need to insert the public IP of my email server with CIDR at the end? Otherwise, I can add all the IP's that my provider could assign me, I remember that in total are 10 different IP's. Thank you
    – MarGraz
    Aug 1, 2020 at 16:24
  • if you are getting 10 IP then find out network IP, CIDR and modify in spf accordingly. Aug 1, 2020 at 17:20
  • Yes you can add at end, can add all the ip but spf accept 255 letters including space. Aug 1, 2020 at 17:47
  • I checked and my internet service provider assign me more than 10 IP's, I stopped the counting at 50 :) I can't add all my IP's to the SPF. I think that I need to try to configuring my main domain "mydomain.com", but I can't do this because it's another server with another public IP... :(
    – MarGraz
    Aug 2, 2020 at 16:16
  • Otherwise I should try to use Gmail as a relayhost... could be a good idea?
    – MarGraz
    Aug 2, 2020 at 16:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .