Exim4 Integration
Adding these two simple files sends a single copy of each incoming AND outgoing email to your
MailArchiva server. Since exim will not deliver duplicate emails, you dont have to worry about that either!
All of this was done with Ubuntu 7.10 and Exim 4.67.
If you have a working Exim system, you should know to backup your entire /etc/exim4 directory.
If you've never used Exim before, I suggest the free VMWare Player and the Ubuntu710server appliance download (
http://www.vmware.com/appliances/directory/1067). I built all this using exactly that. I'll also hopefully be posting a
MailArchiva VMWare appliance soon!
On to the real stuff:
If you're using a split config, create a new router file:
/etc/exim4/conf.d/router/150_exim4-config_mailarchiva_route
(If you're not using the split config, put this as the first router. ORDER MATTERS on routers!)
Put this in it:
# router/150_exim4-config_mailarchiva_route
#################################
# route to mailarchiva archiving service
mailarchiva_route:
debug_print = "R: mailarchiva_route for $domain"
driver = manualroute
transport = remote_smtp_mailarchiva
route_list = * localhost
self = send
unseen
no_verify
Using a split config, create the new transport:
/etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_mailarchiva
(If you're not using the split config, put this anywhere in the tranports section. Order does not matter on transports.)
Put this in it:
### transport/30_exim4-config_remote_smtp_mailarchiva
#################################
# Change port number for mailarchiva (should be called
# from mailarchiva_route
remote_smtp_mailarchiva:
debug_print = "T: remote_smtp_mailarchiva for $local_part@$domain"
driver = smtp
port = 8091
allow_localhost
If using a split config, run:
sudo update-exim4.conf.template -r
Regardless of which config, now restart exim:
sudo /etc/init.d/exim4 restart
That should do it! You can test it with:
exim4 -bt local@email.address
You should see something like:
R: mailarchiva_route for mailarchiva.localdomain
R: lowuid_aliases for
user@mailarchiva.localdomain (UID 1000)
R: system_aliases for
user@mailarchiva.localdomain
R: userforward for
user@mailarchiva.localdomain
R: procmail for
user@mailarchiva.localdomain
R: maildrop for
user@mailarchiva.localdomain
R: local_user for
user@mailarchiva.localdomain
user@mailarchiva.localdomain
<--
user@mailarchiva.localdomain
router = local_user, transport = mail_spool
user@mailarchiva.localdomain
<--
user@mailarchiva.localdomain
router = mailarchiva_route, transport = remote_smtp_mailarchiva
host localhost [127.0.0.1]
Notes:
- This assumes you're running MailArchiva on the same server as Exim. To change the server, change the 'route_list = * localhost' to 'route_list = * YOUR.SERVER.NAME'. You can also remove 'self = send' and 'allow_localhost' if you change the server. I'd suggest just commenting them out.
- This assumes the default MailArchiva SMTP port of 8091. If you've adjusted that port, change the 'port = 8091' to match the correct port.