As a way to fight spam, information about who is entitled to send email for a particular domain will be attached to it using the DNS as a way to publish the information.
Configuration
SPF allow to indicate the hosts (ie: their IPs) allowed to send mail for a particular domain. This is to prevent spam being sent through an external machine using your email address as the address of the sender.
The following example specify to the different mail servers that only
the mrelay1.example.com
host has the right to send messages whose
sender address is of the form @example.com
.
Integration
Postfix
Postfix isn’t build any more with postfix-libspf2 patch, the following section is obsolete.
SPF verifies the legitimacy of the machine sending the mail, this
verification is performed (through the SPF
DNS records) when
receiving the mail using reject_spf_invalid_sender
in
the smtpd_sender_restrictions
definition:
In addition, a white list maintained by trusted-forwarder.org.
will
be checked (directive spf_global_whitelist
). Mail headers wil also
be modified to show the validation results (directive
spf_received_header
). If validation failed the mail will be rejected
(except if the spf_mark_only
directive is set up) and the error
message will show the explanation described by spf_explanation
.