Extending the Delivery Configuration

The main intent of this web page is to show you some more of the many ways in which the driver options can be used

Differentiating between multiple domains

You can differentiate between domains as long as you use a regular pattern for the external files

Differentiating between domains aliases:
   driver = redirect
   data = ${lookup{$local_part}lsearch{/etc/$domain.aliases}}

note: as long as you aliases files match the $domain part you should be ok

Mailing Lists

Exim can manged small simple mailing lists, but for large lists you should use specialized software. A redirect router can be used to "explode" such mailing lists and the domains option can be used if it is required to run these lists in separate domains from normal mail.

A redirect can have two setting

Example lists:
   driver = redirect
   domains = lists.datadisk.co.uk               ## specific domain
   more = false
   file = /etc/lists/$local_part
   errors_to = $local_part-request@$domain      ## check this file, send any errors to users in this file
   forbid_pipe                                  ## prevent local part from being expanded into a pipe
   forbid_file                                  ## prevent local part from being expanded into a filename

You can use external mailing list software, for example Majordomo.

Majordomo example

trusted_users = majordomo            ## you should set this option in Main

   driver = redirect
   data = ${lookup{$local_part}lsearch{/usr/local/majordomo/lists/majordomo.aliases}}
   pipe_transport = address_pipe
   user = majordomo
   group = majordomo

Using an external local delivery agent

The pipe transport can be used to pass messages to local mail software such as procmail.

router procmail:
   driver = accept
   require_files = $home/.procmailrc
   transport = procmail_pipe
transport procmail_pipe:
   driver = pipe
   command = /usr/local/bin/procmail -d $local_part
   check_string = "From "                             ## any from lines, escape (see next line)
   escape_string = ">From "                           ## escape the line
   user = $local_part                                 ## run with the users ID
   group = mail                                       ## group setting of mail

Mixed local/remote Domains

You can use the manualroute to route addresses to remote hosts using local routing data.

Mixed domain example workstation_people:
   driver = manualroute
   local_parts = lsearch;/etc/wsusers     ## restrict this router to those local parts that are found in                                           ## the file
   route_list = * $local_part_data        ## * means all domains, he lookup part above
   transport = remote_smtp

Ignoring the local part in th local deliveries

You can pickup adresses and route to a special transport using the $address_data variable


   driver = accept
   domains = *.isp.example
   address_data = ${if match{$domain}{^([^.]+)}{$1}}    ## $address_data will contain paul
   transport = onebox

   driver = appendfile
   file = /var/mail/$address_data                       ## append file /var/mail/paul
   user = $address_data                                 ## user will be paul

Note: the epression means match a string that begins with the sequence of non-dot characters and saves that sequence in $1, so paul@isp.example $1 would equal paul

Handling Case-sensitive local parts

The local part is by default considered case-sensitive where as the domain part is not. To specify that a particular router is case-sensitive you use the option caseful_local_part. However you must setup the router to be able to correct the case.

Modifying Mesage Bodies

The reasons to modify a message can be

There are a number of problems that can arise if you alter the message body