Re: [exim] using multiply routers

Top Pagina
Delete this message
Reply to this message
Auteur: Todd Lyons
Datum:  
Aan: Cyborg
CC: exim-users
Onderwerp: Re: [exim] using multiply routers
On Mon, Oct 10, 2011 at 12:33 AM, Cyborg <cyborg2@???> wrote:
>
> Hi,
>
> i'm having a small problem with multiply routers,
>
> if the condition inside "userforward" hits, "virtual_user" is not used, but
> may also hit if it would be considered


In my systems, I always set it up so that an email address is either a
forwarder or a mailbox, but never both. Instead, what you seem to
want is to be able to combine both. But your SQL doesn't seem to allow
both to exist:

> userforward:
>  condition = ${if eq{1}{${lookup mysql{SELECT '1' FROM mail_config WHERE
>  address = '${quote_mysql:${local_part}@${domain}}' and type in (
> 'Forwarder') }}}{yes}{no}}
> virtual_user:
>  data = ${lookup mysql{ SELECT concat(target,'/Maildir/') FROM mail_config
> WHERE address = '${quote_mysql:${local_part}@${domain}}' and type in (
> 'Popkonto','Imapkonto') }}


Do you see that one looks for type "forwarder" and the other looks for
type "popkonto" or "imapkonto"? Your logic says that both cannot be
set in the database, so what else would you be looking at to determine
that you want it to do both?

> any of those routers could generate a hit and i want all of the hits to be
> processed , which means,
> if a forwarder targetadress and a mailbox is found in the database, it
> should be send the mail to both
> adresses.
>
> Instead it sends it just to the forwardadresse, cause it's found first.


Make a new router, put it before the forwarder router, you can call it
something like both_forwarder_and_mailbox. Make this new router do
the same as the virtual_user router, but have the condition check for
both Forwarder and local mailbox set in the database and set the
unseen flag.

Regards...        Todd
-- 
If Americans could eliminate sugary beverages, potatoes, white bread,
pasta, white rice and sugary snacks, we would wipe out almost all the
problems we have with weight and diabetes and other metabolic
diseases. -- Dr. Walter Willett, Harvard School of Public Health