[Exim] Condition statement for autoreply

Pàgina inicial
Delete this message
Reply to this message
Autor: Darren Casey
Data:  
A: Exim List
Assumpte: [Exim] Condition statement for autoreply
I have an SQL based system for autoreplys working fine but now want to add a
catch-all auto reply. It should only autoreply if there isn't already an
auto reply setup for an existing account

i.e. pop account here@??? with an auto reply, it should also auto
reply to any other address. That way it wont intefer with existing
auto-replys

I have 2 SQL lookups, one for the exact account and another to check if a
catch all account auto reply is setup

MYSQL_AUTOREPLY_EMAIL = SELECT concat(alias,'@',domain) \
from autoreply WHERE alias = '${quote_mysql:$local_part}' \
and domain = '${quote_mysql:$domain}' limit 1

MYSQL_CATCHALL_AUTOREPLY_EMAIL = \
SELECT concat(alias,'@',domain) from autoreply WHERE \
alias = 'catchall' and domain =\
'${quote_mysql:$domain}' limit 1

autoreply:
driver = accept
condition = ${lookup mysql {MYSQL_AUTOREPLY_EMAIL}{$value}{false}}
transport = auto_message
unseen

catchall_autoreply:
driver = accept
condition = ${if and {\
{eq {${lookup mysql {MYSQL_AUTOREPLY_EMAIL}{$value}}}{false} }\
{eq {${lookup mysql {MYSQL_CATCHALL_AUTOREPLY_EMAIL}{$value}}}{true} }\
}\
{true}{false}}
transport = catchall_auto_message
unseen

The auto reply works but not the catchall one, Im sure I have something iffy
there in the above condition

Any help would be most grateful

Regards
Darren