Below are the actions on SPF test results:
- Bypass - Postfix will not reject the email. It will add the header Received-SPF: PermError, TempError, Softfail, Pass…
- Tempblock - Postfix rejects the email with 4xx error code. The 4xx error code is designed to instruct the sending server to try again at a later time to deliver its email.
- Block - Postfix rejects the email with 5xx error. The 5xx SMTP errors indicate that an email could not be delivered due to a permanent problem. You should not retry sending email flagged with a 5xx error.
To resolve the issue, create a policy for "temperror" and "permerror". Below is the procedure how to create a policy to quarantine or tag SPF checking failed emails.
- Open the file /opt/trend/imss/postfix/etc/postfix/SPFPolicyd/config.ini.
vi config.ini
- Change the action for temperror/permerror to bypass:
[globals]
temperror=bypass
permerror=bypass
When the action is set to bypass, Postfix will not reject the mail and instead, it will insert SPF checking result in the mail header. Therefore, we can create a policy to catch the failed mail. - On the IMSVA console, create a policy.
- Create a policy on Policy > Policy List.
-
On Scanning Conditions, tick the Header keyword expression checkbox.
-
Create TempError keyword.
-
Create PermError keyword.
- Follow the policy creation wizard and set the preferred action (e.g. Tag subject or Quarantine).
- Configure the smtpd_policy_service_timeout to "600".
- Open the main.cf file.
vi main.cf
- Add the value of smtpd_policy_service_timeout at the bottom of the file.
smtpd_policy_service_timeout=600s
- Reload the Postfix.
service postfix reload
- Open the main.cf file.