> Date: Fri, 24 Sep 2004 11:52:33 -0400 (EDT) > From: "David F. Skoll" <[EMAIL PROTECTED]> > Subject: Re: [Mimedefang] Reject vs Drop and MX > To: [EMAIL PROTECTED] > Message-ID: > <[EMAIL PROTECTED]> > 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. _______________________________________________ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

