Marcin Gryszkalis wrote:
> Hi
> As specification says "The generic transport option must not be set for
> redirect router" but I sitll wanted to choose transport:
>
> I have database with users and 2 fields - CC and SMS, both fields specify list
> of addresses to copy message to - the difference is that message should be
> filtered by external filter (in transport) before sending to SMS address (the
> filter removes attachements, html etc.)
>
> dnslookup:
> driver = dnslookup
> domains = ! +local_domains
> transport = ${if eq{$address_data}{SMS}{remote_smtp_sms}{remote_smtp}}
> ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
> no_more
>
>
> mysql_cc:
> driver = redirect
> data = ${lookup mysql {SELECT cc FROM user WHERE
> username='${quote_mysql:$local_part}'
> AND domain='${quote_mysql:$domain}'}{$value}}
> unseen
>
> mysql_sms:
> driver = redirect
> data = ${lookup mysql {SELECT sms FROM user WHERE
> username='${quote_mysql:$local_part}'
> AND domain='${quote_mysql:$domain}'}{$value}}
> headers_add = X-SMS-Gateway-Filter: Yes
> address_data = SMS
> unseen
>
>
> but it seems that $address_data is not good choice for generic variable to
> store such information. For unknown reasons sometimes redirection via CC
> field goes through remote_smtp_sms transport.
>
> I tried to check for header:
>
> transport =
> ${if eq{$header_X-SMS-Gateway-Filter:}{Yes}{remote_smtp_sms}{remote_smtp}}
>
> but it doesn't work...
>
>
> How these redirections could be configured?
>
> best regards
If it is mere presence or absence of the header, not the string it carries, try
'def' instead of 'eq' as in;
quarantine:
driver = accept
transport = quarantine_delivery
condition = "${if def:header_X-Junk:{1}{0}}"
W/R the other snippets - I am not certain that you are setting-up address_data
and testing its content in the appropriate place or sequence. Or even CAse.
You may be more predictably served with use of acl_m variables.
Simply set up the selective steering parameters in acl's before entering the
router/transport sets.
Bill