Re: [exim] REdirection of an e-mail

Top Page
Delete this message
Reply to this message
Author: Heiko Schlittermann
Date:  
To: exim-users
Subject: Re: [exim] REdirection of an e-mail
The Doctor <doctor@???> (Fr 25 Apr 2014 18:53:46 CEST):
> Hello,
>
> how can I do the following:
>
> redirect
>
> user@??? to spam
> user@??? to real mailbox
> user to mailbox
> ?


You're not very specific about your problem.
Depending on your demands there is a multitude
of solutions.

Anyway, it's related to redirecting, thus the redirect
router is your best friend (along with the spec.txt file).

Just use an alias mechanism, but do the lookup using
the domain, not the local_part only. Only if this $local_part@$domain
lookup fails, do a lookup for $local_part only.

    begin routers
    …


        foo:
            driver = redirect
            data = ${lookup{$local_part@$domain}lsearch{/etc/exim/foo}\
                    {$value}\
                    {$lookup{$local_part}lsearch{/etc/exim/foo}{$value}fail}}


The /etc/exim/foo file should contain

    user@???:  spam
    user@???:  mailbox
    user:           mailbox


Depending on what "spam", and "mailbox" are, you may need to add a
file_transport, or pipe_transport to the redirect router. Or you may
need to specify a qualify_domain, or qualify_preserve_domain.

But again, there are shortcuts possible as well as things you may need
to add, in order to get things working.

    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: 7CBF764A -
 gnupg fingerprint: 9288 F17D BBF9 9625 5ABC  285C 26A9 687E 7CBF 764A -
(gnupg fingerprint: 3061 CFBF 2D88 F034 E8D2  7E92 EE4E AC98 48D0 359B)-