Postfix: Block sender

From OnnoWiki
Revision as of 05:01, 28 November 2016 by Onnowpurbo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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