[Exim] sanity check please

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Peter D. Gray
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: [Exim] sanity check please
I am moving from sendmail to exim and writing a config file. I use the
sendmail generics feature to rewrite the local user part of addresses,
both incoming and outgoing. I have got my exim config to do the same
thing but the rule is a bit messy and I just want a few other
eyes on it to tell me if my approach is sane.

The rewrite rule is


# If they are generic domains, rewrite local part

*@*  "${if eq
       {${lookup{$domain}lsearch{GENERIC_DOMAINS}{OK}fail}}{OK}\
       {${lookup{$local_part}dbm{GENERIC_MAP}{$value}fail}@$domain}fail}" Eh


The algorithm is:

    Look up the domain in a file to see if it is a domain
        for which we do local part writes
        The file is GENERIC_DOMAIN (macro)
    If not found, stop.


    If the domain is found, look up the local part in the
        generics map (GENERIC_MAP macro). If not found,
        stop.


    If found, replace the local part of the address with the
        result of the lookup in the generics map.


The messy bit is the domain lookup. The only way I could figure
out to test for the lookup was using the string equality operator
in combiation with a fail. I would like a "search succeeds"
operator but there appears not to be one, hence my question.

To forestall the questions about why you want to do this,
the reason is that lots of our users use their aliases
(firstname_lastname) as their address. We rewrite these aliases
to their usernames so that closed email lists work
consistantly, with no dependency on what email
MUA they are using.

So, am I doing this right or not?

Regards,
pdg

--

See mail headers for contact information.