Re: [Exim] Conditional startup panic condition

Página Inicial
Delete this message
Reply to this message
Autor: Sheldon Hearn
Data:  
Para: exim-users
CC: Tamas TEVESZ
Assunto: Re: [Exim] Conditional startup panic condition
On (2002/07/22 14:35), Philip Hazel wrote:

> > Exactly. How do I test the value of the macro, given that it's used as
> > a component of a path (to the spool directory, for example)?
>
> Here's how to solve your problem:
>
> FOOBAR = unset
> pid_file_path = ${if ! eq{FOOBAR}{unset}{}fail}
>
> An empty value = "unset", so it will revert to the default.
>
> Don't use spool_directory. If the expansion fails, Exim will try to
> write to the log. Where will it put the log if you haven't set
> log_file_path? Er, in the spool directory...


Ha! That's what I'm looking for. I have a macro called SPOOL_NAME
which callers are expected to define as either 'std' or 'slow' on the
command-line, so I used this:

FOOBAR=unset

pid_file_path = ${if                    \
  match {SPOOL_NAME} {^(std|slow)\$}            \
      {/var/run/exim-massmail-deliver-SPOOL_NAME%s.pid}    \
      fail \
  }


spool_directory = /var/spool/exim-massmail-deliver/SPOOL_NAME

Works beautifully, thanks. Now I can add the rest of the macros I've
been wanting to, but haven't for fear of pilot errors.

Ciao,
Sheldon.