Sender Policy Framework (SPF) is a mechanism that an email originating from a certain domain can only be sent via a designated mail server. With this record, sending email from a certain domain is only allowed from the specified mail server. If there is an email that comes from that domain, but doesn't come from the specified mail server, then the email will be rejected. With this mechanism it will reduce spam. With SPF we can know that an email was sent from an IP address (email server) which is indeed allowed to send email from the sender's domain.
Technically, you have to create a DNS entry on your domain, in the form of an SPF record or TXT record and enter a valid list of IP addresses (hosts) that are allowed to send or deliver email on your domain name. Any email sent that is not from the list above, can be confirmed as fake or spoofed and you can set your DNS, so that the recipient's MX (external MTA) can check that incoming mail was indeed sent from the list of valid hosts listed in your DNS.
spf record example:
v=spf1 +a +mx +ip4:104.161.xxx.xxx ~all