SV: SV: [Exim] I need help to implement sendder rules for vi…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Flemming Christensen
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: SV: SV: [Exim] I need help to implement sendder rules for virtualdomain users (WORKS!)
I got it to wotk using macros.
Philip was right .. macros are much easier to debug :)

Thanks for all the help !!!

Flemming


-----Oprindelig meddelelse-----
Fra: Philip Hazel [mailto:ph10@cus.cam.ac.uk]
Sendt: 30. juli 2002 17:24
Til: Flemming Christensen
Cc: Joachim Wieland; Exim-Users (E-mail)
Emne: Re: SV: [Exim] I need help to implement sendder rules for
virtualdomain users


I always split up complicated expansions like this when debugging:


condition = ${if and
               {
               eq {
                    ${lookup mysql
                        {select local_only from user where
                         mailadresse='${quote_mysql:$local_part@$domain}'
                        }
                     }               <<<<<<<
                     {$value}
                  }


That looks like your problem. The } I have indicated terminates the
${lookup. So the {$value} isn't much use here. Mind you, it will just be
an empty string, so it won't do much (but some of the spaces will be
part of the looked up value). Just delete "${value}".

                  {1}{yes}{no}


There's the next problem. eq{x}{y} is a complete condition. Since it is
part of an "and", it must be enclosed inside {}. That's what Exim is
complaining about. You don't want "{yes}{no}" there.

               }


               {
               eq {
                    $lookup mysql{select domain from user
                     ^
                     ^
               Missing { here.


                                  where domain = '${domain:$sender_address}'
                                  }
                     }                 <<<<<<<<<<<<< same remark
                     {$value}          <<<<<<<<<<<<<
                  }


                  {}{yes}{no}          <<<<<<<< and here
               }


             <<<<<<<<<<< This is where you want "{yes}{no}"


             }


If is often helpful to use macros to define long things like SQL
queries, so that the options are easier to read. You need something like

condition = ${if and {                    \
                     {eq {LOOKUP1}{1}}    \
                     {eq {LOOKUP2}{}}     \
                     }                    \
                 {yes}{no}}



where you define the macros (at the top of the config) like so:

LOOKUP1=${lookup mysql{select local_only from user where \
                       mailadresse='${quote_mysql:$local_part@$domain}'}}






--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.