[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: howto select outgoing mail server ???



On Thu, May 08, 2003 at 01:30:04PM -0500, Dave Sherohman wrote:

> > So, I want to figure out how to automate switching outgoing mail servers
> > within either exim or qmail?
> 
> To pass all outgoing mail through a specific server with exim, you
> set it up to use that server as a "smarthost".  I don't know of an
> easy way that you could swap it in and out without having to modify
> exim.conf every time, though.

Well, I think this can be done very easily with exim. In case the
server used as a smarthost is set up in the exim.conf of the
workstation, as it should be, there would be an entry like that:


# use little.yagibdah.de as a smarthost

smart_route:
  driver = domainlist
  transport = remote_smtp
  route_list = "* little.yagibdah.de byname"


Now, to route mails going to certain domains, you would just set up
another router like that:


# route certain domains via another server
# Note the changed route_list parameter below:

certain_domains_route:
  driver = domainlist
  transport = remote_smtp
  route_list = "*certain.domain.com other.server.com byname"


more_certain_domains_route:
# ...


smart_route:
# [as above]


Since the order of the routers is relevant, the smarthost router
should be the last one of the routers that route to remote
hosts. Thus, all mails going to domains that require special routeing
won't go via the smarthost.

I didn't try out such a setup, so please refer to the exim
documentation (info exim, there's a seperate package you need to
install). You even can look up the domains to route in files and such.

Maybe it's possible to setup a complicated route list in just one
router. You could ask about more details on the exim-users
mailinglist.

Another problem to solve is the SMTP-after-POP setup providers
commonly use. It would eventually prevent exim from sending mails via
the providers server ...

At least, I'd recommend to switch from qmail to exim. Exim is utterly
well documented and amazingly easy to configure. Qmail seems to be
more interesting in special setups where performance is most
important, while sendmail is, hmm, for crazy geeks :)


GH



Reply to: