[Mimedefang] Re: MIMEDefang Digest, Vol 12, Issue 57

Troy Carpenter troy at carpenter.cx
Sun Sep 26 14:17:41 EDT 2004


There are those times when I say to myself, "why didn't I see that
before".  This is one of those times.

I have already rewritten my filter to take advantage of all the things I
have learned in this thread.

As a result of this suggestion, I wrote a subroutine called "is_my_mx()"
that checks the hostname (not IP) against my backup MX name, and uses it
whereever I was checking the global flag before.

And with the multiple RBL check routines, I have sped up my filter and now
avoided unforseen global variable problems.

Thanks guys!

> Date: Fri, 24 Sep 2004 15:31:57 -0700
> From: Kelson <kelson at speed.net>
> Subject: Re: [Mimedefang] Reject vs Drop and MX
> To: mimedefang at lists.roaringpenguin.com
> Message-ID: <4154A05D.6030700 at speed.net>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Troy Carpenter wrote:
>> Then the only change in my solution to the _originally_ asked MX problem
>> is to write out a file to $CWD in the filter_relay() routine indicating
>> that the MX was used (instead of using the RELAY flag from before) and
>> check for that file in filter_begin().  The original logic remains the
>> same.
>
> It's probably easier to just check the value of $RelayAddr (it's the IP
> address of the relay) in filter_begin(). Something roughly like this:
>
> if ( $RelayAddr eq 'my_mx_ip'* ) {
> 	return action_discard();
> } else {
> 	return action_bounce("Stop sending us viruses!")
> }
>
> *Pick your favorite method for finding one item in a list. (array, hash,
> regexp, etc.)
>
> You only *really* need to use filter_relay if you want to act on the
> info before SMTP DATA.
>
> --
> Kelson Vibber
> SpeedGate Communications <www.speed.net>




More information about the MIMEDefang mailing list