[Exim] Autoreply condition syntax problem

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: David Buxton
Dátum:  
Címzett: exim-users
Tárgy: [Exim] Autoreply condition syntax problem
Hello,

I am trying to implement an auto-reply where mail account info is
stored in MySQL.

Following previous posts to the list, I have Exim working so that my
autoreply director looks up an auto-reply bit for an account and only
acts if this bit is set on.

Here's an example record from the `passwd` MySQL table with
non-relevant fields omitted:
id         => david@???
maildir    => /home/mail/example.com/david/Maildir/
vacationOn =>    y




IN DIRECTORS...
vacation:
    driver = smartuser
    unseen
    no_expn
    no_verify
    condition = ${lookup mysql {SELECT maildir FROM passwd \
                  WHERE id LIKE '${local_part}@%' AND id LIKE
'%@${domain}' \
                  AND vacationOn = 'y'}{$value}fail}
    transport = vacation_user


(N.B. This director works for me, except I've left out setting a
user/group for delivery).

This director does what I want, only generating auto-replies where an
address in the MySQL table has vacationOn = 'y'.

Now I want to combine this condition with a second condition, so that
the director is not called when the incoming message is from a mailing
list.

C019 in Exim's config.examples has a condition that does this:

condition = "${if or {{match {$h_precedence:} {(?i)junk|bulk|list}} \
                         {eq {$sender_address} {}}} {no} {yes}}"


Therefore I need to produce a condition which combines what I have
already with the example from C019. So far I have failed to produce
something that works. This is what I have tried:

    condition = ${if and { {${if or{{match
{$h_precedence:}{(?i)junk|bulk|list}} \
                   {eq {$sender_address}{}}}{no}{yes}} } \
                   ${lookup mysql {SELECT maildir FROM passwd \
                   WHERE id LIKE '${local_part}@%' AND id LIKE
'%@${domain}' \
                   AND vacationOn = 'y'}{$value}fail}{yes}{no}}


(hellish brackets, I know, and that's probably what I'm doing wrong).

In Exim's mainlog, I get this message:

2002-11-20 10:58:11 18ESYd-000PL1-00 failed to expand condition"${if
and { { ${if or{{match {$h_precedence:}{(?i)junk|bulk|list}}{eq
{$sender_address}{}}}{no}{yes}} }${lookup mysql {SELECT maildir FROM
passwd WHERE id LIKE '${local_part}@%' AND id LIKE '%@${domain}' AND
vacationOn = 'y'}{$value}fail}{yes}{no}}" for vacation director:
condition name expected, but found "${if or{{match {"



Any ideas gratefully accepted,

David B.