[Mimedefang] How can I block spam mail addressed FROM me TO me if not HELO match of my SMTP server?

Paul Murphy pjm at ousekjarr.org
Wed Feb 24 02:45:59 EST 2010


Assuming you have a single/small list of domains, in filter_recipient:

$LocalRelayAddrs{"192.168.78.2"} = 1;   # me!
$LocalRelayAddrs{"127.0.0.1"} = 1;

my $mysender=lc($sender);
$mysender=~ s/[<>]//g;
my $myrecip=lc($recipient);
$myrecip =~ s/[<>]//g;
if (
     ($mysender=~ /mydomain.com$/i) &&
     ($myrecip =~ /mydomain.com$/i) &&
     (! exists $LocalRelayAddrs{$ip}) 
   )
  {
  action_notify_administrator("Message-id:    $MsgID\nSender:
$sender\nRecipient:     $recipient\nAddress:    $ip\nHostname:
$hostname\nHelo:        $helo\n\nBounced because an external party
claims to be us\n");
  # can't use graphdefang_log here...
  md_syslog('info', "MDLOG,$MsgID,Spoof,0,$ip,$sender,$recipient,?");
  return("BOUNCE","You are not one of our users, so you can't send as
us!");
  }

Best Wishes,

Paul.



More information about the MIMEDefang mailing list