[exim] router condition, problem with "and"

Etusivu
Poista viesti
Vastaa
Lähettäjä: Jonas Forsberg
Päiväys:  
Vastaanottaja: exim-users
Aihe: [exim] router condition, problem with "and"


Hello.
I am fairly new to exim4, so please be patient with me.

I'm
trying to get a condition for a router to work as I expect, but I
clearly have issues understanding the syntax.

The condition consists of
two parts:

1st a check in the Subject field after a string, that I have
got to work.

condition = ${lookup mysql{
SELECT email FROM users

WHERE email='${quote_mysql:$local_part}@${quote_mysql:$domain}'}

{true}{false}}

2nd a check in a MySQL table, which I have been
working.

condition = ${if match
{$h_subject:}{N^KalleKalas$N}{yes}{no}}

but to combine those two into a
"and rule" makes my head spin. What ever I do exim4 logs that it can not
expand the condition.

I hope that some kind soul can point me in the
right direction so that I get this router to deliver it to a pipe
transport

thanks in advance

Jonas ForsbergFrom kaz@??? Wed Aug 18 20:05:13 2010
Envelope-to: exim-users@???
Received: from idcmail-mo1so.shaw.ca ([24.71.223.10]:45778)
    by tahini.csx.cam.ac.uk with esmtp (Exim 4.72)
    (envelope-from <kaz@???>) id 1Olnwm-00045y-P5
    for exim-users@???; Wed, 18 Aug 2010 20:05:13 +0100
Received: from pd3ml3so-ssvc.prod.shaw.ca ([10.0.141.149])
    by pd4mo1so-svcs.prod.shaw.ca with ESMTP; 18 Aug 2010 13:05:11 -0600
X-Cloudmark-SP-Filtered: true
X-Cloudmark-SP-Result: v=1.1 cv=uT3SUsFrUxSLMLkvWEyF5PJ45gYvcyNzEdQWRoVmi+I=
    c=1 sm=1
    a=Xw47zlpAUnsA:10 a=jPJDawAOAc8A:10 a=VphdPIyG4kEA:10 a=YJw43DjnkvMA:10
    a=IkcTkHD0fZMA:10 a=sbTcoBTXrGEWw7cXuT52uw==:17 a=q34bkTyjAAAA:8
    a=XAnge1dB05JtdEIYV3MA:9 a=TKyptKZ8YIY60INZOL3ACopU7DUA:4
    a=QEXdDO2ut3YA:10
    a=hB6TBpPrBZUA:10 a=horXCyLY2AIz_fLf:21 a=5GLglWW_Oq4_ZkIG:21
    a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
Received: from unknown (HELO localhost) ([24.85.143.66])
    by pd3ml3so-dmz.prod.shaw.ca with ESMTP; 18 Aug 2010 13:05:10 -0600
Received: from www-data by localhost with local (Exim 4.69)
    (envelope-from <kaz@???>) id 1OlnwM-0001En-5X
    for exim-users@???; Wed, 18 Aug 2010 12:04:46 -0700
To: <exim-users@???>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit
Date: Wed, 18 Aug 2010 12:04:46 -0700
From: Kaz Kylheku <kaz@???>
In-Reply-To: <20100818170735.GA49825@???>
References: <e6e4e5dfbb92ba6a58878fedd96137dc@127.0.0.1>
    <20100818170735.GA49825@???>
Message-ID: <d0c9356dae6c5eb6db404bc976a6b9b3@127.0.0.1>
X-Sender: kaz@???
User-Agent: Roundcube Webmail/0.4
X-Spam-Score: -1.5 (-) 
X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00=-1.5,
    SUBJECT_EXCESS_QP=0 autolearn=no version=3.1.8
X-Mailman-Approved-At: Thu, 19 Aug 2010 08:41:24 +0100
Subject: Re: [exim] =?utf-8?q?How_to_configure_sieve_filtering=3F?=
X-BeenThere: exim-users@???
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: A user list for the exim MTA <exim-users.exim.org>
List-Unsubscribe: <http://lists.exim.org/mailman/listinfo/exim-users>,
    <mailto:exim-users-request@exim.org?subject=unsubscribe>
List-Archive: <http://lists.exim.org/lurker/list/exim-users.html>
List-Post: <mailto:exim-users@exim.org>
List-Help: <mailto:exim-users-request@exim.org?subject=help>
List-Subscribe: <http://lists.exim.org/mailman/listinfo/exim-users>,
    <mailto:exim-users-request@exim.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Aug 2010 19:05:13 -0000



On Wed, 18 Aug 2010 13:07:35 -0400, Phil Pennock
<exim-users@???> wrote:
> The split configuration system is a Debian addition, not supported here
> at the upstream; you should have a README.Debian.gz in
> /usr/share/doc/exim4/ which walks you through making sure that you
> regenerate the configuration file from the parts, if needed.


Anyway, all I did was transplant my configuration change,
exactly as I wrote it last night, from the
file under conf.d to the single configuration template.

The setup now passes the hello-world test: a test message now
goes into my maildir inbox.

webserver:/etc/exim4# quilt diff
Index: exim4/exim4.conf.template
===================================================================
--- exim4.orig/exim4.conf.template      2010-08-18 11:52:21.000000000
-0700
+++ exim4/exim4.conf.template   2010-08-18 11:57:30.000000000 -0700
@@ -1431,6 +1431,16 @@
   envelope_to_add
   return_path_add


+  maildir_format
+
+  directory = ${if eq{$address_file}{inbox} \
+         {$home/Maildir} \
+         {${if eq{${substr_0_1:$address_file}}{/} \
+                   {$address_file} \
+                   {$home/Maildir/$address_file} \
+           }} \
+  }
+
 #####################################################
 ### end transport/30_exim4-config_address_file
 #####################################################




But multiple things refer to the address_file transport.
Is it really okay to do this?

For instance the "mail4root" router wants to be able
to use the address_file transport to add
to /var/mail/mail.

Surely, the right thing is to create a new transport
which is a clone of address_file, but under a different
name?