Home » Postfix » How to enable rbls in postfix to prevent spam messages.

How to enable rbls in postfix to prevent spam messages.

This article will describe that how to enable rbls in postfix and prevent the spam mails on the server. Configure Postfix to verify the IP address of the incoming mail against one or more RBL’s. If the IP is a contest, then server will not accept the message from listed ip addres. So enable the RBL’s in postfix we need to modify smtpd_recipient_restrictions parameter in the main Postfix configuration file /etc/postfix/main.cf).

smtpd_recipient_restrictions =
reject_rbl_client cbl.abuseat.org,
reject_rbl_client b.barracudacentral.org,
reject_rbl_client dnsbl-1.uceprotect.net,
reject_rbl_client zen.spamhaus.org,
reject_rbl_client bl.spamcop.net,
reject_rbl_client dnsbl.sorbs.net,
permit

Once this configuration done, restart postfix

#service postfix restart
Oct 2 15:58:24 mailserver postfix/smtpd[15573]: NOQUEUE: reject: RCPT from unknown[102.xx.xx.xx]: 554 5.7.1 Service unavailable; Client host [102.xx.xx.xx] blocked using zen.spamhaus.org?; http://www.spamhaus.org/sbl/query/SBLCSS / http://www.spamhaus.org/query/bl?ip=102.xx.xx.xx; from=<info@xyz.com> to=<admin@serverdomain.com> proto=ESMTP helo=

In addition to RBL’s, you can prevent your mail server from relaying and receiving spam by implementing some of the following configuration options under the smtpd_recipient_restrictions parameter:

reject_invalid_hostname – Reject the request when the HELO or EHLO hostname is crooked. This can potentially prevent poorly programmed bots from sending spam to your server.

reject_unknown_recipient_domain – Reject the request when Postfix is not final destination for the recipient domain. This can avoid your server from being used as an open relay.
reject_unauth_pipelining – Reject the request when the client sends SMTP commands ahead of time where it is not allowed. This is useful for prevent bulk mailing.
Append the following lines in your postfix mail configuration file.

smtpd_recipient_restrictions =
reject_invalid_hostname,
reject_unknown_recipient_domain,
reject_unauth_pipelining,
permit_mynetworks,
reject_unauth_destination,
reject_rbl_client zen.spamhaus.org,
reject_rbl_client bl.spamcop.net,
reject_rbl_client dnsbl.sorbs.net,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client b.barracudacentral.org,
reject_rbl_client dnsbl-1.uceprotect.net,
permit

I hope this article  is useful for you to reduce the spam volume on your posfix mail server.

About

I am founder and webmaster of www.linuxpcfix.com and working as a Sr. Linux Administrator (Expertise on Linux/Unix & Cloud Server) and have been in the industry since more than 14 years.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Time limit is exhausted. Please reload the CAPTCHA.

Categorized Tag Cloud