The Problem
Consider the Apache vhost myweb.com. Someone sends an email to
info@myweb.com. We want exim4 to spot that and use sendmail to send the mail to
the approved user. frequently that person might be sat behind gmail or something
similar.
The components
- Everything is done via exim4 config with the addition of a new router and
vhost specific alias files which contain the email mappings. - The text here assumes you have NOT split your configuration
- All exim configuration is done using the exim4.conf.template file.
The solution
- Edit /etc/exim4/exim4.conf.template.
- Modify the local domains definition
# List of domains considered local for exim. Domains not listed here
# need to be deliverable remotely.
domainlist local_domains = @:localhost:dsearch;/etc/exim4/virtualhosts
This tells exim which domain names are considered for for further processing.
- Insert the following additional router code before systemalias handling (400):-
#####################################################
### router/350_exim4-config_vdom_aliases
#####################################################
vdom_aliases:
driver = redirect
allow_defer
allow_fail
domains = dsearch;/etc/exim4/virtualhosts
data = ${expand:${lookup{$local_part}lsearch*@{/etc/exim4/virtualhosts/$domain}}}
retry_use_local_part
pipe_transport = address_pipe
file_transport = address_file
no_more
#####################################################
### end router/350_exim4-config_vdom_aliases
######################################################################################## - A cursory glance at the code suggests that /etc/exim4/virtualhosts will play a
part. It does! - Create a file for each vhost you wish to redirect email for. From our example
we create /etc/exim4/virtualhosts/myweb.com. In it we place our email
mappings. Here is an example:-
info: info@gmail.com
webmaster: webmaster@gmail.com
--
My Emacs Files At GitHub
No comments:
Post a Comment