Re: [Exim] Conditional startup panic condition

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Sheldon Hearn
日付:  
To: exim-users
CC: Tamas TEVESZ
題目: 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.