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

Re: Smart relay setting for Exim...



Darryl L. Pierce wrote:
> My question, is there a way to configure Exim to use my ISP's
> SMTP server and my SMTP server at work without having to
> manually change settings when I go from one place to the other?

I do not know how exim, but I have here with postfix this in
/etc/postfix/Makefile

   neu: neu-prepare all

   ppp: ppp-prepare all

   ppp-prepare:
      cp -f main.cf.ppp main.cf
      cp -f sender_canonical.ppp sender_canonical

   neu-prepare:
      sed -e 's/surfbest.net/neu.edu/g' main.cf.ppp > main.cf
      sed -e 's/surfbest.net/neu.edu/g' sender_canonical.ppp \
      > sender_canonical

Then it is easy to create (courtesy of sudo) this script called
smtp:

   #!/bin/sh
   ( cd /etc/postfix ; sudo -u root /usr/bin/make "$@" )

and in the script run whenever your are checking emails this
(smtp.neu.edu is a SMTP server when I am connected through LAN
and in variable MYISP I have name of the currently active ISP --
American or Czech):

	if /sbin/ifconfig | grep -q '^ppp' \
		&& grep -q 'smtp.neu.edu' /etc/postfix/main.cf
	then
		smtp $MYISP
	fi

Does it help?

   Matej

-- 
Matej Cepl,
Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
 
Opinions founded on prejudice are always sustained with the
greatest violence.
    -- Hebrew Proverb



Reply to: