1.
add the following to the /etc/postfix/main.cf configuration file
smtpd_delay_reject = yes
smtpd_helo_required = yes smtpd_helo_restrictions =
permit_mynetworks,
check_helo_access
hash:/etc/postfix/helo_access,
reject_non_fqdn_hostname,
reject_invalid_hostname,
permit
2.
create the file /etc/postfix/helo_access
and add your restriction like example:
myowndomain.com REJECT
pcname PERMIT
3.
create the database (you don’t need restart postfix)
postmap /etc/postfix/helo_access
4.
postfix check
restart or reload postfix
/etc/init.d/postfix reload
or
/etc/init.d/postfix restart
print out configuration
postconf -n
mailq to see the mail in queue
To remove all mail from the queue, enter:
postsuper -d ALL
Accept mail without any postgray check:
vim /etc/postfix/rbl_override
gmail.com OK gmail.it OK yahoo.com OK hotmail.com OK outlook.com OK startcomca.com OK libero.it OK
and my main.cf
smtpd_recipient_restrictions =
reject_unauth_pipelining,
check_helo_access hash:/etc/postfix/helo_access,
check_client_access hash:/etc/postfix/rbl_override,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
permit_mynetworks,
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_sender_login_mismatch,
reject_non_fqdn_helo_hostname,
permit_sasl_authenticated,
check_policy_service unix:/var/spool/postfix/postgrey/socket,
reject_unauth_destination,
reject_unverified_recipient,
check_recipient_access pcre:/etc/postfix/recipient_checks.pcre,
#check_client_access pcre:/etc/postfix/client_checks.pcre,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client sbl.spamhaus.org,
reject_rbl_client pbl.spamhaus.org,
reject_rbl_client zen.spamhaus.org,
reject_rbl_client bl.spamcop.net,
reject_rbl_client b.barracudacentral.org,
#####reject_rbl_client dnsbl-1.uceprotect.net,
#reject_rbl_client dnsbl.sorbs.net,
#reject_rbl_client dnsrbl.org,
#reject_rbl_client bl.blocklist.de,
#reject_rbl_client babl.rbl.webiron.net,
#reject_rbl_client cabl.rbl.webiron.net,
permit
after this configuration type:
postmap /etc/postfix/rbl_override
restart postfix