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

Re: Exim configuration for Laptop



    "Jamin" == Jamin W Collins <jcollins@asgardsrealm.net> writes:

Jamin,

I actually do not use exim much on my laptop, but these hints might
help since I looked into this when I first got it some 2 years
ago. However, as things turned out, I rarely, if ever, send mail from
it so I can't say I have any real experience.

    Jamin> Since the laptop won't always be in the same place or even
    Jamin> on the same network chances are quite good that any
    Jamin> "smarthost" it is configured to use will at some point
    Jamin> refuse to relay messages for it.  Thus, it would seem that
    Jamin> options 2 and 3 are ruled out.

Actually, IMHO, option 2 (smarthost) is a very good one.

Basically, you don't have external systems deliver mail to your
laptop. You probably run fetchmail, and by some magic it always gets
your mail and uses exim for local delivery. Or maybe you don't run
fetchmail and do something else. The bottom line is: no one looks up
an MX or A record for your laptop and then contacts it to deliver
email. So that fact that option 2 does not allow incoming mail is
okay. 

For outgoing mail the problem really is: how do you figure out what
the SMTP server to use is for the smarthost?

I suggest you start with the smarthost file and keep hacking at it
until it works ("exim -C path/to/exim.conf.file -bt user@host" is a
very good way to test what exim would do).

One trick that worked for me: define two smart hosts. The first one
works 99% of the time (on the big-I Internet in my case), the second
1% of the (company intranet firewalled from the bad guys outside). My
first smarthost setting adds a "host_find_failed = pass" line so if
the lookup fails (which it would in the intranet) exim goes on to the
next router. Works for me. I rarely send mail from the intranet. On
the public intranet I have not run into a case where my public ISP
SMTP server was barred as yet (yeah, I don't get around with my laptop
as much as I should ;-)

BTW your host_find_failed value could be set to 'freeze' on the second
(last) router. All failed mail would be frozen. Then when you got a
good place you could unfreeze and retry everyting. Not pretty, but a
start. 

    Jamin> Is this the best way to configure things?

Don't know. Sorry. But I got another idea for you to consider.

You could run a script when your ethernet or other IP interface is
bought up that writes the best choice for SMTP server using some magic
to a file. Ask exim to read that file and deliver accordingly.

For example, change your smarthost router's route_list from "*
my.smarthost.com bydns_a" to "*
${lookup{smarthost}lsearch{/var/misc/smarthost}{$value}{smtp.smarthost.com}}
bydns_a". 

Now generate a file called /var/misc/smarthost evertime you ifup your
eth0 (or what have you) that used the IP address of your laptop to see
if could guess a better smarthost. Write that to /var/misc/smarthost
like this

smarthost: guessed.smarthost.com

and exim will use that. If you can't guess it, leave the file empty,
and exim will use smtp.smarthost.com as a default.

You get the idea. The exim specification is hard to read, but the
effort is well worth the trouble!

Of course, I'm suspect that one of the many packages that support
roaming laptops will provide this built in. Hopefully some one else
will clue you into a better way of doing this. But I've found learning
exim to be some kind of fun.....

Good luck! Let us know what finally works for your. Maybe I will start
using my laptop to send mail for real!

Cheers!
Shyamal



Reply to: