Problem Description
The email was bounced with the following error:
554 Reject by behaviour spam at Rcpt State(Connection IP address:x.x.x.x)ANTISPAM_BAT[01201311R506a, ay29a033002195083]: spf
check failed CONTINUE (in reply to RCPT TO command)
Causes
The error message indicates that the SPF verification fails. This means that the email you sent does not pass the SPF verification so it is returned.
The reason for not passing SPF verification is that the IP address is not within the IP range set by SPF record.
Solutions
Please make sure that you are sending emails using the correct SMTP server address.
If the email address is Alibaba Mail, please refer to IMAP, POP and SMTP Server and Port Information of Alibaba Mail.
Check the domain name resolution records of the mailbox to make sure there is a TXT record with the value v=spf1 include:spf.sg.aliyun.com -all .
If this record does not exist or is inconsistent with the value of an existing record, please add or modify it.
After the update is complete, wait for 10-20 minutes. After the resolution takes effect, resend the email for testing to confirm that the problem has been fixed.
If the email address is not Alibaba Mail:
It is suggested that the administrator of the relevant mailbox should be fed back to add the sending IP to the SPF range in the domain name resolution. Before adding, please ensure that it is a non-shared IP and IP are trusted to prevent the sending of counterfeit letters.
Record value syntax example:
Domain name + domain name: v=spf1 include:spf.sg.aliyun.com include:spf1.dm.aliyun.com -all
Domain name + IP: v=spf1 include:spf.sg.aliyun.com ip4:x.x.x.x -all
Domain name + IP range (caution): v=spf1 include:spf.sg.aliyun.com ip4:x.x.x.x/24 -all
Additional Information
What is SPF?
SPF is the acronym for Sender Policy Framework in email systems and it is a very efficient spam solution. The receiving party will determine whether the IP address of the sender is in the SPF record according to the SPF record of the domain name. If it is, it will be considered as a correct email, otherwise it will be considered as a forged email to return.
Add Method:
Description
If your domain name is not purchased by Alibaba Cloud, we recommend that you consult the service provider where your domain name is located.
Here we use Alibaba Cloud DNS as an example:
1. Log on to the Alibaba Cloud DNS Console and select the domain name that you want to resolve. Click DNS Settings to go to the Resolution Settings page.
2. In the resolution setting interface, click "Add DNS Record", fill in the record and click "OK".
Example:
Record Type: TXT
Hostname: @
Record Value: v=spf1 include:spf.sg.aliyun.com -all
Description
If you have other sending IP, you can add the record value to SPF resolution in the form of v=spf1 IP4:IP address include:spf.sg.aliyun.com -all
. Please make sure that the IP is a trusted IP. If it is a shared IP, there is a risk of being counterfeited.
3. Wait for the record to take effect after the setting is complete. To query the currently configured SPF record, please check Trusted IP Query Method for SPF Records.