How does SPF work?

SPF allows the owner of a domain to specify which servers are authorized to send an email on behalf of that domain. When an email is received, the recipient's server can check the SPF record of the domain in the email's 5321.MailFrom or Return-Path address to see if the sending server is authorized. If the sending server is not authorized, the email may be marked as spam or rejected.