[exim] Making A Compound Condition - With Or + And

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Brian Spraker
Data:  
Para: exim-users
Assunto: [exim] Making A Compound Condition - With Or + And
Hello all,

I am needing to make a compound condition for a vacation checking system.

I am using the information from this page:

https://github.com/Exim/exim/wiki/EximAutoReply

Further down on that page, there is a lot of condition checks that are done before sending out a message.

Trouble is - this is an "OR" condition. I also need to include an "AND" to this as well. There is a column in the database that contains whether the user's vacation auto reply should be turned on or off.

Here is that condition:

condition = ${if eq{${lookup mysql{SELECT vacation_enabled FROM horde_users WHERE user_uid="${quote_mysql:${local_part}}"}}}{y}}

Then, the condition from the Exim site above:

condition = ${if or { \
    { match {$h_precedence:} {(?i)junk|bulk|list} } \
    { eq {$sender_address} {} } \
    { def:header_X-Cron-Env: } \
    { def:header_Auto-Submitted: } \
    { def:header_List-Id: } \
    { def:header_List-Help: } \
    { def:header_List-Unsubscribe:} \
    { def:header_List-Subscribe: } \
    { def:header_List-Owner: } \
    { def:header_List-Post: } \
    { def:header_List-Archive: } \
    { def:header_Autorespond: } \
    { def:header_X-Autoresponse: } \
    { def:header_X-Autoreply-From: } \
    { def:header_X-eBay-MailTracker: } \
    { def:header_X-MaxCode-Template: } \
    { match {$h_X-Auto-Response-Suppress: } {OOF} } \
    { match {$h_X-OS:} {HP Onboard Administrator} } \
    { match {$h_X-MimeOLE:} {\N^Produced By phpBB2$\N} } \
    { match {$h_Subject:} {\N^Yahoo! Auto Response$\N} } \
    { match {$h_Subject:} {\N^ezmlm warning$\N} } \
    { match {$h_X-FC-MachineGenerated:} {true} } \
    { match {$message_body} {\N^Your \"cron\" job on\N} } \
    { match {$h_Subject:} {\N^Out of Office\N} } \
    { match {$h_Subject:} {\N^Auto-Reply:\N} } \
    { match {$h_Subject:} {\N^Autoresponse:\N} } \
    { match {$h_Subject:} {\N(Auto Reply)$\N} } \
    { match {$h_Subject:} {\N(Out of Office)$\N} } \
    { match {$h_Subject:} {\Nis out of the office.$\N} } \
    { match {$h_From:} {\N(via the vacation program)\N } } \
    } \
                       } {no} {yes} \
               }


How can one go about making this a compound condition that allows both the use of OR as well as AND?

Also - the condition from the Exim site looks like it has an extra close bracket in it. Surprised that hasn't been updated on the Exim site.

Thank you!

Brian S.