On 02/09/15 14:35, Gary Stainburn wrote:
> I'm looking to create an aliases table something along the lines of
>
> localuser varchar(80)
> alias varchar(80)
> internalonly boolean
> allowfrom boolean
> allowto boolean
> redirectto varchar(80)
> failto varchar(80)
^^^^^^^^^^^
Just use text. There's no benefit to limiting field sizes.
>
> I want to then replicate the currect action if a row exists with alias1 =
> alias and failto is not null.
>
> I'm guessing I need to do this as a router and here is the pseudo code I'm
> thinking (taken from the localuser systemalias). Am I right, and what would
> the correct syntax be?
>
> failuser:
> deriver = redirect
> condition = ${lookup pgsql{select failto from aliases \
> where alias = '${quote_pgsql:$local_part}' \
> and failto is not null}}
> data = :fail: This user is no longer available. For assistance please \
> contact <value returned from lookup
>
>
how about something like:
failuser:
driver = redirect
data = ${lookup pgsql{select failto from aliases \
where alias = '${quote_pgsql:$local_part}' \
and failto is not null} \
{:fail: This user is no longer available. For assistance \
contact $value} \
}
--
Jeremy