In the Spring Festival, the mail system sent a large number of emails, and the system also accumulated a large number of emails. Suddenly, it was found that the most accumulated emails were from yahoo.com.cn and yahoo.cn.
Later, I thought it was because yahoo Mail stopped its service. Because users had previously registered with yahoo Mail, they repeatedly sent emails to yahoo Mail after purchasing tickets, about emails will be accumulated in a day. simply discard emails from yahoo Mail to save trouble.
1. Modify the postfix configuration file and add the following lines:
Smtpd_sender_restrictions = check_recipient_access hash:/etc/postfix/drop_domain
2. Create a rule file:
Vim/etc/postfix/drop_domain
Add the following lines
Yahoo.com.cn DISCARD
Yahoo.cn DISCARD
This means that if you encounter an email from yahoo.com.cn and yahoo.cn, DISCARD the email directly)
3. database files for production rules
Postmap drop_domain
4. Reload the postfix configuration file:
Service postfix reload
The following information is displayed in the log:
Jan 7 01:55:58 dp58-04 postfix/smtpd [31146]: NOQUEUE: discard: RCPT from unknown [10.1.217.68]: <*** @ yahoo.com.cn>: Recipient address triggers DISCARD action; from = <××× @ ×××.com.cn> to = <××× @ yahoo.com.cn> proto = SMTP helo = <test>
POSTFIX directly discards the email