[Mimedefang] Reject vs Drop and MX

Troy Carpenter troy at carpenter.cx
Fri Sep 24 12:27:51 EDT 2004


> Date: Fri, 24 Sep 2004 11:52:33 -0400 (EDT)
> From: "David F. Skoll" <dfs at roaringpenguin.com>
> Subject: Re: [Mimedefang] Reject vs Drop and MX
> To: mimedefang at lists.roaringpenguin.com
> Message-ID:
> 	<Pine.LNX.4.58.0409241151190.4633 at shishi.roaringpenguin.com>
> Content-Type: TEXT/PLAIN; charset=US-ASCII
>
> On Fri, 24 Sep 2004, Troy Carpenter wrote:
>
>> 1. Turn on filter_relay and filter_recipient checking.
>> 2. In filter_relay() I do the following:
>>    * Check to see if the connecting relay is local. If so, accept with
>> no
>>      further processing.
>>    * Check to see if the connecting relay is one of my known relays...
>>      that is, is it my backup MX, or my ISP's relay (I don't want to
>>      blindly accept SPAMs originating from others on my ISP).  If this
>>      condition is met, then I set a RELAY flag for later use.
>
> Don't do that.  Your filter will suffer random and unpredictable failures.
> See the section  "GLOBAL VARIABLE LIFETIME" in the mimedefang-filter man
> page.
>

According to that section, the first entry says that if I define my global
outside of all routines, it is available to all routines.  Does that imply
that if I change that global variable within a routine that my change
doesn't keep after the routine ends?

My RELAY flag is first declared at the top of my filter along with the
other globals I have setup for use in various routines.  I have used this
arrangement for over a year and have never seen any failures due to this
(I print MDLogs every time this little routine is triggered, so I see when
sendmail logs that the relay is my backup MX, I always see the
corresponding MD log as well, plus I have logwatch print out how many
times this routine was triggered).  Similarly, I have never had problems
with the other globals in the past 3 years I have been using them.

Am I doing it right, or should I go out and buy a lottery ticket today? :)

>> 4. In filter_begin(), I first check the RELAY flag.
>
> See comment above.

Likewise.




More information about the MIMEDefang mailing list