How to enchance e-mail SPAM protection in ISPConfig 3. In the end we will be able to
Reject sender hostnames with invalid syntax
Reject sender hostnames that are no fully qualified domains (e.g. reject “server1” but allow server1.domain.tld)
Reject sender domains that have no DNS records
Check sender IP addresses against realtime blacklists
Always ensure that you make a copy of your configuration file. In this case its at /etc/postfix/main.cf on Debian.
sudo cp -pf /etc/postfix/main.cf /etc/postfix/main.cf.bak
Then execute this command as sudo
sudo postconf -e 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_hostname, reject_non_fqdn_hostname, reject_unknown_recipient_domain, reject_non_fqdn_recipient, reject_unauth_destination, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_rbl_client cbl.abuseat.org,reject_rbl_client dul.dnsbl.sorbs.net,reject_rbl_client ix.dnsbl.manitu.net, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination'
Then restart postfix so that your changes will take effect immediately.
sudo /etc/init.d/postfix restart