[Mimedefang] Using relay_check()

Steve Robb steve_robb at cnt.com
Wed Jul 17 16:36:01 EDT 2002


David,

OK, thanks for the advice and the sample code. I think given my (lack of)
Perl expertise I'll stick with the Sendmail configuration.

Steve Robb


-----Original Message-----
From: David F. Skoll [mailto:dfs at roaringpenguin.com] 
Sent: Wednesday, July 17, 2002 3:29 PM
To: 'mimedefang at lists.roaringpenguin.com'
Subject: Re: [Mimedefang] Using relay_check()


On Wed, 17 Jul 2002, Steve Robb wrote:

> I wanted to try and use the DNSBL relay check that's built into MD but 
> was having a bit of trouble figuring out how to get started.

DNSBL is not built into MIMEDefang.  That kind of thing is better done from
the Sendmail configuration file.

However, if you start mimedefang with the "-r" option, and you use the
multiplexor, then every time an SMTP connection is made, the function
filter_relay is called.  Here's an example for your filter file:

sub filter_relay ($$) {
	my($hostip, $hostname) = @_;

	if ($hostip eq "192.168.3.3") {
		return(0, "I don't like you!");
	}

	if ($hostname =~ /\.spammer\.com$/) {
		return(-1, "I'm gonna tempfail you!");
	}

	return (1, "OK, we'll proceed.");
}

If you want to do DNSBL checks, it's up to you to write the Perl code to do
the lookup.  Not hard; just tedious.

Regards,

David.

_______________________________________________
MIMEDefang mailing list
MIMEDefang at lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang



More information about the MIMEDefang mailing list