[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: exim4 - disabling rewriting for intranet messages : the debian way



References: <20030424165017$55d6@gated-at.bofh.it>

> I use exim4 and I need to rewrite local addresses in mail that goes
> to the outside world, but not for messages that remain within the
> local intranet.
> [...]
> My question is : how to add these directives in order to respect the
> debian configuration scheme ?

I found the solution :
1) Don't declare anything any /etc/exim4/email-addresses (or else,
   addresses are always rewritten)
2) Instead, use a custom file : /etc/exim4/email-addresses-intranet
3) Append the following lines to 30_exim4-base_remote_smtp
   in /etc/exim4/conf.d/transport

--
# translate outgoing email adresses to fully qualified adresses, as
# ruled by the file /etc/exim4/email-adresses-intranet
  headers_rewrite = *@intranet         ${lookup{$1}lsearch{CONFDIR/email-addresses-intranet}{$value}fail} : \
                    *@router          ${lookup{$1}lsearch{CONFDIR/email-addresses-intranet}{$value}fail} : \
                    *@localhost        ${lookup{$1}lsearch{CONFDIR/email-addresses-intranet}{$value}fail} : \
                    *@router.intranet ${lookup{$1}lsearch{CONFDIR/email-addresses-intranet}{$value}fail}
  return_path = ${if match{$return_path}{\N^([^@]+)@(intranet|router|localhost|router.intranet)$\N}{${lookup{$1}lsearch{CONFDIR/email-addresses-intranet}{$value}fail}}fail}
--

And addresses are only rewritten for outgoing emails... Exactly what I need :-)

_____________________________________________________________
Washington DC's Largest FREE Email service. ---> http://www.DCemail.com ---> A Washington Online Community Member --->
http://www.DCpages.com

_____________________________________________________________
Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag



Reply to: