[Mimedefang] Message Mime Data - Relays
Daniel Aquino
mr.danielaquino at gmail.com
Thu May 24 13:09:56 EDT 2007
> What more did you want to know about the relays?
I wanted a list of "all" relays... not just the last hop...
But I think what I'll do is check in filter_relay for the sender ip,
and then in filter_begin I'll check the header relays...
Here is my code in case you have any suggestions...
Thanks!
================================
http://silowyi.pastebin.ca/507566
================================
# Check Sender Country via Ip::Country::Fast
sub relay_country ($) {
# arguments
my($ip) = @_;
# wanted countries (local-networks , usa , canada)
my @wanted = qw(US CA **);
# ip country fast object
use IP::Country::Fast;
my $ip_country = IP::Country::Fast->new();
# detect country
my $country = $ip_country->inet_atocc($ip);
# accept if wanted
for my $country_code (@wanted) {
if ( $country eq $country_code ) {
#md_graphdefang_log('good_country_relay', $ip, $country);
return 1;
}
}
# default deny
return 0;
}
More information about the MIMEDefang
mailing list