Exim's Rewrite Configuration

I have already explained a little about rewrite rules, the section begins with the heading "begin rewrite ".

 
######################################################################
#                      REWRITE CONFIGURATION                         #
######################################################################

begin rewrite

#####################################################
### end rewrite/00_exim-config_header
#####################################################
#####################################################
### rewrite/31_exim-config_rewriting
#####################################################

### rewrite/31_exim-config_rewriting
#################################

# This rewriting rule is particularily useful for dialup users who
# don't have their own domain, but could be useful for anyone.
# It looks up the real address of all local users in a file
*@+local_domains "${lookup{${local_part}}lsearch{/etc/email-addresses}\
                   {$value}fail}" Ffrs
# identical rewriting rule for /etc/mailname
DEBCONFrewriteemailaddresses_mailnameDEBCONF


#
# Fold all sub domains for *.datadisk.co.uk into datadisk.co.uk
# For example root@somehost.datadisk.co.uk will be rewritten as
# root@datadisk.co.uk. This is to hide our internal server
# structure from the rest of the world
#
*@*.datadisk.co.uk         $1@datadisk.co.uk

#
# OK ... Here is the hack to get datadiskcorp folded back into
# the datadisk domain. Any From:, Sender: or Reply-to: fields with
# xxx@datadiskcorp.co.uk will be rewritten into xxx@datadisk.co.uk
#
*@datadiskcorp.co.uk        $1@datadisk.co.uk           Ffrsbc


#####################################################
### end rewrite/31_exim-config_rewriting
#####################################################

Rewrite Definition

  begin rewrite

Dailup Rewrite Rule

This rewriting rule is particularily useful for dialup users who don't have their own domain, but could be useful for anyone. It looks up the real address of all local users in a file

 
*@+local_domains "${lookup{${local_part}}lsearch{/etc/email-addresses}\
                   {$value}fail}" Ffrs
# identical rewriting rule for /etc/mailname
DEBCONFrewriteemailaddresses_mailnameDEBCONF

Company Specific Rewrite Rules

 
*@*.datadisk.co.uk         $1@datadisk.co.uk
*@datadiskcorp.co.uk       $1@datadisk.co.uk           Ffrsbc

Note: For more on the flags Ffrsbc see address header