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

Re: exim on laptops: smarthost on demand



Hi Andreas

On Mon, Jul 28, 2003 at 03:11:36PM +0200, Andreas Gredler wrote:
> I've been trying to find a way that I can use a smarthost only when I'm
> connected to a specific network. That means when I'm at home I don't
> want to use a smarthost, when I'm at work I have to use a smarthost.
> It would be easy to rewrite the whole exim configfile, but that is not
> the way that I prefer.
> 
> I've found two other ways, but none did work.
> First:
> 
> smarthost:
>   driver = domainlist
>   transport = remote_smtp
>   route_list = "${lookup{ip}lsearch{/etc/smarthost}{$value}{*}} 
>   ${lookup{smart}lsearch{/etc/smarthost}{$value}} byname"
>   (This is one line, just made a linebreak for better reading)
>   
> It didn't work because it seems to be impossible to make a lookup on the
> domain. No matter what the file contains, it is ignored.
> If I write
> route_list = "* ${lookup{smart}lsearch{/etc/smarthost}{$value}} byname"
> it works.

You almost got it to work:  I'm using the same lookup trick by I do a
"bydns_a" not a "buname".  Here is my smart host entry (with like breaks
inclused where necessary:
  smarthost:
    driver = domainlist
    transport = smtp
    #
    # The following line allows dynamic routing of outgoing mail.  The file
    # /var/state/exim/smarthost has the following format:
    #     smarthost <smarthost>
    # It is written by a the various start up scripts to where outgoing mail
    # should be sent.  When connected to my ISP (Demon) it points to
    # "post.demon.co.uk".
    route_list = "* ${lookup{smarthost}lsearch{/var/state/exim/smarthost}{$value}
{no.smart.host}} bydns_a"
  end

> routefile:
> * my_smarthost.at byname

I have no routefile in my exim.conf 
 
> Has someone another idea or knows what went wrong with the methods
> described above?

Hope this helps

Steve

Attachment: pgpEGl4OKsidy.pgp
Description: PGP signature


Reply to: