[Mimedefang] Bouncing on invalid HELO/EHLO
Michael Sims
michaels at crye-leike.com
Thu Jun 12 15:07:10 EDT 2003
Quoting Edgars Klepers <mimedefanglist at eklynx.com>:
> 2 subnets 204.182.112.64/27 and 64.38.151.160/27 (32 ip range)
Using my code I posted before, this should do it:
---CUT HERE---
use Socket;
sub relayIsTrusted($) {
my ($address) = @_;
my %trustedSubnets = (
'127.0.0.1' => '255.255.255.255',
'204.182.112.64' => '255.255.255.224',
'64.38.151.160' => '255.255.255.224'
);
my $trustedRelay = 0;
my $addr = inet_aton $address;
while (my ($networkString, $netmaskString) = each %trustedSubnets) {
my $network = inet_aton $networkString;
my $netmask = inet_aton $netmaskString;
if (($addr & $netmask) eq $network) { $trustedRelay = 1; last; }
}
return $trustedRelay;
}
---CUT HERE---
I kept localhost in there in case you have any messages that are sent through
the sendmail mail submission deamon...
___________________________________________
Michael Sims
Project Analyst - Information Technology
Crye-Leike Realtors
Office: (901)758-5648 Pager: (901)769-3722
___________________________________________
More information about the MIMEDefang
mailing list