Difference between revisions of "Postfix: Block sender"

From OnnoWiki
Jump to navigation Jump to search
(New page: Sumber: http://www.cyberciti.biz/faq/howto-blacklist-reject-sender-email-address/ Q. I’ve Postfix based CentOS Linux server. I need to blacklist email ID: user@abadboy.com . How d...)
 
 
Line 1: Line 1:
 
Sumber: http://www.cyberciti.biz/faq/howto-blacklist-reject-sender-email-address/
 
Sumber: http://www.cyberciti.biz/faq/howto-blacklist-reject-sender-email-address/
  
 +
cd /etc/postfix
 +
vi sender_access
  
Q. I’ve Postfix based CentOS Linux server. I need to blacklist email ID: user@abadboy.com . How do I blacklist email address with postfix? I also have spamassassin software installed.
+
Masukan address yang ingin di block
  
A. By default, the Postfix SMTP server accepts any sender address. However you can block / blacklist sender email address easily with Postfix. It has SMTP server access table.
+
user@abadboy.com        REJECT
 +
myfriend@example.com    OK
 +
junk@spam.com          REJECT
 +
marketing@              REJECT
 +
theboss@                OK
 +
deals.marketing.com    REJECT
 +
somedomain.com          OK
  
Open /etc/postfix/sender_access file
+
Save & close file. Lakukan postmap untuk membuat database
# cd /etc/postfix
+
 
# vi sender_access
+
postmap hash:sender_access
Append sender email id as follows:
+
 
user@abadboy.com REJECT
+
Edit main.cf & tambagkan
Save and close the file. Use postmap command to create a database:
+
 
# postmap hash:sender_access
+
smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/sender_access
Now open main.cf and add code as follows:
+
 
smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/sender_access
+
restart postfix
Save and close the file. Restart / reload postfix MTA:
+
 
# /etc/init.d/postfix restart
+
/etc/init.d/postfix restart
  
 
You can also use spamassassin to blacklist email address. Just add to your own spamassassin configuration or to /etc/mail/spamassassin/local.cf file:
 
You can also use spamassassin to blacklist email address. Just add to your own spamassassin configuration or to /etc/mail/spamassassin/local.cf file:
# vi /etc/mail/spamassassin/local.cf
+
 
 +
vi /etc/mail/spamassassin/local.cf
 +
 
 
Append blacklist as follows:
 
Append blacklist as follows:
blacklist_from user@abadboy.com
+
 
 +
blacklist_from user@abadboy.com
 +
 
 
Save and close the file. Restart spamassassin:
 
Save and close the file. Restart spamassassin:
# /etc/init.d/spamassassin restart
+
 
 +
/etc/init.d/spamassassin restart
  
 
spamassassin will marke mail as SPAM instead of rejecting the same.
 
spamassassin will marke mail as SPAM instead of rejecting the same.

Latest revision as of 05:01, 28 November 2016

Sumber: http://www.cyberciti.biz/faq/howto-blacklist-reject-sender-email-address/

cd /etc/postfix
vi sender_access

Masukan address yang ingin di block

user@abadboy.com        REJECT
myfriend@example.com    OK
junk@spam.com           REJECT
marketing@              REJECT
theboss@                OK
deals.marketing.com     REJECT
somedomain.com          OK

Save & close file. Lakukan postmap untuk membuat database

postmap hash:sender_access

Edit main.cf & tambagkan

smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/sender_access

restart postfix

/etc/init.d/postfix restart

You can also use spamassassin to blacklist email address. Just add to your own spamassassin configuration or to /etc/mail/spamassassin/local.cf file:

vi /etc/mail/spamassassin/local.cf

Append blacklist as follows:

blacklist_from user@abadboy.com

Save and close the file. Restart spamassassin:

/etc/init.d/spamassassin restart

spamassassin will marke mail as SPAM instead of rejecting the same.



Referensi