Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Thread

Include config files

Include config files

2006-07-17 by Ugo Bellavance

Hi,

  Is it possible to "include" a config file with milter-greylist?  I'd
like to have a set of directive in another file than greylist.conf.

Regards,

Ugo

Re: [milter-greylist] Include config files

2006-07-17 by Emmanuel Dreyfus

On Mon, Jul 17, 2006 at 03:36:16PM -0000, Ugo Bellavance wrote:
>   Is it possible to "include" a config file with milter-greylist?  I'd
> like to have a set of directive in another file than greylist.conf.

Implementing this leads to a small issue: we need to monitor all the
included files for changes (reminder: libmilter catches signals, so 
we cannot use SIGHUP to reload config, and we have to monitor config
file changes). That is possible for local files, but if we want to
include remote files, that would break.

-- 
Emmanuel Dreyfus
manu@...

Re: Include config files

2006-07-18 by Ugo Bellavance

--- In milter-greylist@yahoogroups.com, Emmanuel Dreyfus <manu@...> wrote:
>
> On Mon, Jul 17, 2006 at 03:36:16PM -0000, Ugo Bellavance wrote:
> >   Is it possible to "include" a config file with milter-greylist?  I'd
> > like to have a set of directive in another file than greylist.conf.
> 
> Implementing this leads to a small issue: we need to monitor all the
> included files for changes (reminder: libmilter catches signals, so 
> we cannot use SIGHUP to reload config, and we have to monitor config
> file changes). That is possible for local files, but if we want to
> include remote files, that would break.

I only use local config files, so that wouldn't be a problem.  Is it
hard to implement?
Show quoted textHide quoted text
> 
> -- 
> Emmanuel Dreyfus
> manu@...
>

Re: [milter-greylist] Re: Include config files

2006-07-18 by manu@netbsd.org

Ugo Bellavance <iolubik@...> wrote:

> I only use local config files, so that wouldn't be a problem.  Is it
> hard to implement?

The difficult point is that conf_parse() is not re-entrant. You cannot
just call it again from itself each time you see an include directive. 

That probably means you need to have two passes. First pass looks for
include directives, builds a flat file and second pass actually parse
the file.

So we would have to add a new parser, for instance in files called 
preconf_lex.l preconf_yacc.y. It would build a flat config in a
temporary file and a chained list of included files to monitor. 

Next step is to modify the config reload code:
1) monitor the list of included files
2) If a change was detected, create a temporary file with mkstemp
3) Call preconf_parse() 
4) Call conf_parse()
 
-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

RE: [milter-greylist] Include config files

2006-07-19 by attila.bruncsak@itu.int

>   Is it possible to "include" a config file with milter-greylist?  I'd
> like to have a set of directive in another file than greylist.conf.

Hi,

I generate the actual config file with a small script,
using a template config file and extracting the e-mail
addresses of the greylisting subscribed users from a
flat file database. I don't really need the include
directive.

Bests,
Attila

Re: [milter-greylist] Include config files

2006-07-19 by Emmanuel Dreyfus

On Wed, Jul 19, 2006 at 10:13:40AM +0200, attila.bruncsak@... wrote:
> I generate the actual config file with a small script,
> using a template config file and extracting the e-mail
> addresses of the greylisting subscribed users from a
> flat file database. I don't really need the include
> directive.

Me too, FWIW...

-- 
Emmanuel Dreyfus
manu@...

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.