The if statemenet is no different that other language. IF is always preceeded with "$" and wrapped in curly braces.
${if <condition> {Value for True} {Value for False}}
If the condition evaluates or expands in eximeeze to be true the first option in curly braces is executed. If not the second is.
What can be confusing is the condition may also have a similar construct. Lets look at one.
${if eq{$local_part} {kennyl} {Action for true} {Action for false} }
Now there are four sections in curly braces. The first two is for eq
where $local_part
and kennyl
are compared for equality. The two after that belong to the if statement.