EXIM 4 relay to smarthost: How to route all mail except local domain EXIM smarthost: How to route all mail except local domain, how to route all mail except those for localdomain(s) to a smarthost, exim relay to smarthost
My Favourite MUA/MTAs are Exim and Qmail.
On my webserver I'm using Exim 4.6 as Mail Transfer/User Agent and I needed to route all emails sent by web forms to my dedicated mail server (running Qmail), except those mails which are intended for localhost/localdomain.
EXIM 4 relay to smarthost: How to route all mail except local domain
In order for Eximt to route all relay mail to a smarthost, open your Exim configuration file (on FreeBSD, you can find it in /usr/local/etc/exim/) and go to the router section and search for the begin routers line and add a new router:
###################################################################### # ROUTERS CONFIGURATION # # Specifies how addresses are handled # ###################################################################### # THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! # # An address is passed to each router in turn until it is accepted. # ######################################################################
begin routers
#SOME COMMENTED LINES AND ROUTERS .............................................................
#BEGIN smarthost relay mail route smart_host_relay: driver = manualroute route_list = !+local_domains 192.168.116.20 transport = remote_smtp #END
The smart_host_relay:keyword defines the router. Next few lines instruct it to route all emails except those for local domain to my smtp mail IP address, to use it as a relay smtp server.
Usually, this router should be added at the beginning of the section (after begin routers line), but, depending on your configuration, it should be added after additional routers.
Designed and developed by Andrei Manescu. Optimized for Mozilla Firefox.
Copyright 2007 Andrei Manescu
All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by those who posted them.