问题原文
原帖链接 · Theo Orphanos · CC BY-SA 3.0
I have a centos 6.5 server running apache and hosting about 8 domains. There is also postfix 2.6 installed serving these local domains to send emails generated by php (website contact forms). Postfix installation is default. No modifications have been made to main.cf or any other file.
Now, one of the websites has been hacked and is sending spam emails using addresses such as: random_user1@hacked_domain.com, random_user2@hacked_domain.com, random_user3@hacked_domain.com (hacked_domain.com is the actual domain name of the hacked website)
I want to block this particular (local) domain from sending, while all other domains sould send normally. So far, I have created a "blacklist" which I saved in postfix folder named "rbl_blacklist" and looks like that:
hacked_domain.com REJECT
How can I use this file in main.cf in order to prevent messages from ***@hacked_domain.com from being sent?
(also, any other suggestions are welcome)
EDIT:
I do not want to block certain users, since there aren't any! I just want to block all email messages that are sent from: *@hacked_domain.com from being sent!
已采纳解答
原帖链接 · Theo Orphanos · CC BY-SA 3.0
The solution was "header_checks"
In main.cf comment out any "header_checks" lines -if exist and then add:
header_checks = pcre:/etc/postfix/header_checks.pcre
Create header_checks.pcre file (at the postfix folder)
# cd /etc/postfix
# vi header_checks.pcre
inside header_checks.pcre file added the following line:
/^From:((?![^@]*?user1|[^@]*?user2|[^@]*?user3|[^@]*?webmaster)[^@]*?)@hacked_domain\.com/ DISCARD
(we allow only user1, user2, user3 and webmaster to send emails -the other addresses get discarded!)
# service postfix restart
...and worked!
Hope that helps others with similar issues!
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
