[Mimedefang] file descriptor scope and embedded perl

alan premselaar alien at 12inch.com
Mon Jul 5 20:27:51 EDT 2004



Chris Masters wrote:

> Hi All,
> 
> Since upgrading to the latest MIMEDefang today I have
> bad file descriptor errors - I assume this is an
> embedded perl scope issue.
> 
> So, I currently do the following:
> 
> 1) I do *not* use filer_initialise
> 2) The file descriptor are global and are declared
> *outside* of any function.
> 3) valid connections are made using a 'connection test
> function' within functions called within the 3 main
> filter functions.
> 4) file descriptors are closed in filter_cleanup
> 
> I take it that I shouldn't be doing 2?
> 
> Can/Should I declare *slave* globals in
> filter_initialise?
> 
> Thanks for your help,
> 
> Chris
> 

Chris,

   The documentation for mimedefang-filter specifically states that if 
you're using Embedded Perl, you *MUST* use filter_initialize to 
initilize variables (such as file descriptors) that need to be seen 
across slaves.

with embedded perl, the (outside of any subroutine) global variables are 
only initialized once on initial startup, and not on a per-slave basis.

check the mimedefang-filter man pages for more specific information.

hope this helps.

alan



More information about the MIMEDefang mailing list