2

In a VPS with 2 IPv4 and 16 IPv6, I send emails with postfix. Each time, the email is sent from one of the IPs randomly

Received: from domain.com (a random IPv6 out of my 16 IPv6)

Thus, SPF fails (of course, softfail), as the originating IP is not in my DNS record. I can set a range of IP in DNS's SPF record, but how can I tell postfix to submit email from the main IP (the one I set rDNS)?

Googlebot
  • 1,047
  • 2
  • 15
  • 30

1 Answers1

3

There are two options available for binding smtp client to particular IPs/IPv6s (man 5 postconf):

  • smtp_bind_address
  • smtp_bind_address6

I think they are pretty self-descriptive. Just make sure that related NICs/IPs are defined by inet_interfaces option.

By the way, SPF records support multiple originating IP addresses per domain. Try to generate it with this SPF wizard. Just a quick example:

domain.com. IN TXT "v=spf1 a mx a:1.2.3.4 a:1.2.3.5 a:1.2.3.6 ~all"
domain.com. IN SPF "v=spf1 a mx a:1.2.3.4 a:1.2.3.5 a:1.2.3.6 ~all"
dsmsk80
  • 5,817
  • 18
  • 22