Setting up Exim to forward mail

You will need to use a redirect router. Read the Exim Router specification, as it can do many things and thus can get quite complex.

Basically, you will need to set something up like this (untested)


sender_redirect:
  driver = redirect
  data = ${lookup{$sender_address}lsearch{/etc/exim4/sender_redirects}}

Then create a file in /etc/exim4/sender_redirects that contains the redirects in a line-separated colon-delimited format, like this:


[email protected]: [email protected]

A variation on what Joe Freeman said, without using dsearch (which gave me unknown lookup type "dsearch" error):

In the beginning of exim.conf:

#Replace:
domainlist local_domains = lsearch;/etc/virtual/domains
#With:
domainlist local_domains = lsearch;/etc/virtual/domains : lsearch;/etc/virtual/forwarding_domains

In the section "begin routers" add:

sender_redirect:
    driver = redirect
    domains = lsearch;/etc/virtual/forwarding_domains
    data = ${lookup{$local_part}lsearch{/etc/virtual/forwarding/$domain}}

In lsearch;/etc/virtual/forwarding_domains add your domains one per line:

example.com

And create /etc/virtual/forwarding/example.com containg:

me: [email protected]

Exim4 also supports old-style .forward files, plus Exim-style .forward files which begin with # Exim filter. for example, to use the latter to forward to my backup account while keeping the original in my spool for POP3 access:

# Exim filter  <== do not edit or remove this line!

unseen deliver [email protected]

far simpler, and less dangerous, than monkeying around as root in the bowels of Exim configuration, IMO. full details on this are here.