Can't send mails with SNM (Mailserver)

It’s me again with another NixOS mail server problem.

I configured the mail server exactly as described in the documentation.
Receiving emails works fine. The problem is the sending. The mails only seem to go out when sending, but they don’t arrive and after ~1 day the message comes that the mails cannot be delivered.
The output of journalctl -fu postfix gives the following result:

May 18 19:44:31 nb-main postfix/smtpd[1078575]: connect from ip-046-005-255-250.um12.pools.vodafone-ip.de[XX.XX.XX.XX]
May 18 19:44:31 nb-main postfix/smtpd[1078575]: Anonymous TLS connection established from xx.pools.vodafone-ip.de[XX.XX.XX.XX]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256
May 18 19:44:31 nb-main policyd-spf[1078581]: 550 5.7.23 Message rejected due to: SPF fail - not authorized. Please see http://www.openspf.net/Why?s=mfrom;id=xx@nerdbude.com;ip=xx.xx.xx.xx;r=<UNKNOWN>
May 18 19:44:31 nb-main postfix/smtpd[1078575]: NOQUEUE: reject: RCPT from xx.pools.vodafone-ip.de[xx.xx.xx.xx]: 550 5.7.23 <xx@web.de>: Recipient address rejected: Message rejected due to: SPF fail - not authorized. Please see http://www.openspf.net/Why?s=mfrom;id=post@nerdbude.com;ip=xx.xx.xx.xx;r=<UNKNOWN>; from=<xx@nerdbude.com> to=<xx@web.de> proto=ESMTP helo=<smtpclient.apple>
May 18 19:44:31 nb-main postfix/smtpd[1078575]: disconnect from xx.vodafone-ip.de[xx.xx.xx.xx] ehlo=2 starttls=1 auth=1 mail=1 rcpt=0/1 quit=1 commands=6/7

(I anonymized the IPs)
As I read that there is an SPF error in the DNS entries.
I have already tested various SPF entries but none worked. (currently: v=spf1 ip4:xx.xx.xx.xxx ip6:xxxx:xxx:xxxx:xxxx:: ~all)

someone an idea?
Thanks

So as the message says, this is an SPF issue and not related to nixos as such.

Without the full SPF record (and therefore domain and the IPs) it’s impossible to say how your SPF record is misconfigured.

1 Like