Autor: OpenMacNews Data: A: exim-users Assumpte: Re: [exim] way to delay by time of day?
hi fred,
>| another approach would be to reach OUT -- i.e., use a series of conditionals
>| in the 'delay =' stanza that use ${run<command> expansion to reach out to
>| the shell's date/time function ... but, again, 'kludgy'.
>
> It wouldn't be as ugly as that, you don't need conditionals. Just
> ${run a program or script that writes the appropriate delay string to
> stdout, which is available to you in $value.
yup. i keep (naiively) 'forgetting' about the availble 'return' value. grrr.
>| is there another/better approach for this?
>
> I don't know about "better". You good do something a lot uglier
> looking but possibly faster within exim by using one of the $tod_*
> variables and ${sg or ${substr to get the time/date components you
> want (day of week, hour) into $acl_mN variables. Then a long set of
> nested ${if to set the desired delay. Hmm, or maybe an lsearch
> file...
ok, so i've COMPLETELY missed the "$tod_*" vars .... more RTFM'ing.
> If it were me, I'd write a small C program (for performance) to
> calculate the delay and ${run it.
this actually sounds the fastest/least overhead>
${run-ing a shell-script that does the same is the easiest/laziest.
using $tod_* vars in the exim.conf may be tidiest ...