######################################################################
# HELO/EHLO greeting section
######################################################################
# A remote host can't be localhost or localdomain
deny hosts = !+relay_hosts
message = $sender_helo_name is a silly HELO
condition = ${if match
{$sender_helo_name}
{N^(127.0.0.1|localhost(.localdomain)?)$N}
{yes}{no}}
Here is an example of the message dropped by the above rule. The sending host claims its a remote host.
2006-03-27 03:38:35 H=(localhost) [86.106.55.32] F=
2006-03-27 03:38:36 unexpected disconnection while reading SMTP command from (localhost) [86.106.55.32]