[Mimedefang] regarding varibles lifetime(scope) in mimedefang-filter
Jan-Pieter Cornet
johnpc at xs4all.nl
Fri Jan 18 03:04:16 EST 2008
On Fri, Jan 18, 2008 at 12:05:45PM +0530, vinita batra wrote:
> Hi,
> I am using mimedefang filter for some processing on incoming mail.
> Actually i want to know if i set some vatriables in filter_begin and
> performs operation on that variable in filter() then those variables
> will be reinitialized for each incoming mail or not?
>
> For example:
> if i decalre some variable say count=0 in filter_begin().
> then suppose filter() does count++; and accesses it at the end of filter()
>
>
> Now suppose i send one mail then it will be processed by mimedefang filter
> so filter_begin will be exceuted and will set count=0;
> and when filter comes to count++ it will make count =1;
>
> Now before count is accessed by filter (in the end of filter),
> suppose i send another mail
> so again filter_begin() will be exceuted and it will set the count=0;
>
> suppose now the filter()called by first mail reaches at the end of
> procedure and accesses the count variable. then at this time,
> filter() will see count=1 or count=0?
You probably want to read the "MAINTAINING STATE" part in
man mimedefang-filter. It's all explained there.
--
Jan-Pieter Cornet <johnpc at xs4all.nl>
!! Disclamer: The addressee of this email is not the intended recipient. !!
!! This is only a test of the echelon and data retention systems. Please !!
!! archive this message indefinitely to allow verification of the logs. !!
More information about the MIMEDefang
mailing list