[Mimedefang] Enumerating MX host IP's

Kenneth Porter shiva at sewingwitch.com
Fri Mar 26 09:45:29 EST 2004


--On Friday, March 26, 2004 8:49 AM -0500 "Kevin A. McGrail" 
<kmcgrail at pccc.com> wrote:

> I believe he is talking about doing this for his OWN mx records.

Correct. Right now I have this:

sub mta_is_my_mx ($) {
    my ($mta_ip) = @_;
#    return 0 || ($mta_ip =~ /^66.28.14.59/);
    return 0 || ($mta_ip =~ /^24.7.84.78/);
}

sub action_discard_executables ($) {
    my($fname) = @_;
    if (mta_is_my_mx($RelayAddr)) {
        # don't pester mx backup
        return action_discard();
    } else {
        return action_bounce("Executable content $fname not accepted here");
    }
}

I'd like to change the static list of IP's to a computed list taken from my 
MX list. (The "0 ||" idiom is because in one incarnation I had multiple 
MX's and that made all the terms except the first the same, to make it easy 
to edit.)

It would also be nice to record the expiration time of the records so that 
the list could be cached within MD and not looked up each time on the 
nameserver. (It's running on the same box, though, so maybe that's a false 
economy.)



More information about the MIMEDefang mailing list