[HOW TO] black list Postfix

Once upon a time I met a problem with Postfix. The customer sent to me the ticket, in this she told me that she received many email spams from @e-m-a-i-l.com

Politely I said to her that I will find the solution for this case. So, she can save time. I drank a cup of water before discovering.

In the first, I have to check the log to find the exactly email who is spammer?
So easy, because the customer sent me the email of spammer. Next, I went to postfix log to find out.
One moment in time, I found that.

So, I need to add the spammer to postfix's black-list file.
Firstly, I created the black-list file:
#vim /etc/postfix/sender_access

#DISCARD: the sender don't receive the response 
#REJECT: the sender receives the response.

And then, I created the postfix's database
postmap hash:/etc/postfix/sender_access

I added the paragraph below to /etc/postfix/main.conf 
smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/sender_access 

Restart to apply the change
service postfix restart

After that, I opened the Postfix's log and keep my eyes. I didn't see any email from w.morrison@gmail.com.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

0 nhận xét:

Post a Comment