Value assign in if condition part
Hi,
I like to know if I can assign value to a variable in the if-statement condition part, below example will help you to understand the scenario.
I modified the Exim filter file and defined some keywords (more than 500) that if those keywords are found in the email subject then the email will be rejected. Now I want to store the value of that word that matches the condition write it on the bounceback message or in the error log file.
I want to do something like that,
if
("$h_subject:" contains "aaa" and variable="aaa")
or ("$h_subject:" contains "aab" and variable="aab")
or ("$h_subject:" contains "aac" and variable="aac")
.
.
.
or ("$h_subject:" contains "zzz" and variable="zzz")
then
fail text "Word found Mail reject, the word found $variable"
endif
The $variable value contains which I have assigned above in if condition after and operator.
Let me know if this is possible or any other alternative way to achieve it.
regards,
Sajawal
Please sign in to leave a comment.
Comments
0 comments