Postfix SPF DNS problem

Hi I have a Postfix mail server in a Debian Linux network and used to be able to connect to it on port 25 via telnet. I also have working DNS on the server.

I added this MX record to the DNS zone file:

@  IN  MX  10  server.c4.sysinst.ida.liu.se.

It worked fine after that also but then I added this SPF record, the goal is that only the server is supposed to be able to send mail from the nework:

@    IN     TXT     "v=spf1 mx ip4:130.236.189.218 mx:server.c4.sysinst.ida.liu.se ~all"

But after I added that I'm not able to connect using telnet localhost 25 on the server. Help would be appreciated.

Which SPF package did you install? The Perl package or the Python package?

Postfix actually got uninstalled while I was adding the spf records, no wonder I couldn't connect to the postfix server. I can connect now but the emails sent to outside my network aren't being delivered, only the ones sent inside the network. And the clients are still able to send even though only the server is supposed to be. mail.log says:

server postfix/qmgr[2561]: warning: connect to transport smtp: Connection refused

Maybe that's because the spf record is wrong, do you have to install a SPF package to get the record to work, BIND isn't enough?

Yes you have to install an additional package. Usually a perl and a python package are both available. Pick either one and install.