[EMAIL PROTECTED] writes:
> 
> So I am about to modify my "ip-up" script to do the following: do 
> an nslookup on the IP # I get sent, in order to get the name of the
> "machine" that I've been given, and then insert this machine name into
> /var/qmail/control/defaulthost.  I have tested this "by hand" e.g.
> getting the machine-name and doing a "telnet freebsd.org smtp" with
> EHLO etc, and it works.
>

Hi Alan. Sure. As a fragment:

In /etc/ppp/ip-up:

    #!/bin/sh
    #
    # Arguments:
    #     $1) interface name
    #     $2) tty device
    #     $3) speed
    #     $4) local ip
    #     $5) remote ip
    #
    # Dispatch to the service being provided-use the local ip and remote ip
    # to determine the connectivity:
    #
    case "$4" in
    #
    # From some local ppp to some other local ppp if needed:
    #
    "172.17.4.15")
        blah-blah
        ;;
    #
    # Connectivity not understood, so far, possibly an ISP machine.
    #
    *)
        #
        # Look at the first three octets of the dotted quad notation
        # address of the remote, ie., look at the class C address of the
        # remote, which is the network address:
        #
        case `echo "$5" | /usr/bin/sed 's/\.[0-9]*$//'` in
            #
            # From mymachine to ISP running ppp?
            #
            "123.45.67")
                do stuff to bring the line up like route commands,
                etc., and get things running and remember the IP.
                .
                .
                .
                if echo ':amachine.myisp.com' > "/var/qmail/control/smtproutes"
                then
                    if echo 'whatever you want' > "/var/qmail/control/defaulthost"
                    then
                        if echo 'amachine.myisp.com' > "/var/qmail/control/helohost"
                        then
                            if killall -HUP qmail-send
                        fi
                    fi
                fi
                .
                .
                .
                whatever other stuff
                ;;
                #
                # Connectivity not understood, fall through to the exit.
                #
                *)
                ;;
            esac
        ;;
    esac

You will need to reverse the process in /etc/ppp/ip-down.

        John

BTW, another alternative is to use slirp in a shell account on the ISP
instead of pppd. Then your local LAN can be assigned the private
network IPs, (IP_MASQUERADING also does much the same thing, and there
is a HOW-TO for it.) Then you don't have to worry what IP your ISP
assigns you, and it is always the same from your side. (But you would
have to provide your own DNS, and there is a HOW-TO for that, too.)

I have had my ports scanned over pppd from an ISP, and tend to,
personally, prefer slirp, which runs through IP redirection-so it is
difficult for the Internet vandals to find what IP to use. Note that
if your From:/Reply-To: headers are correct with your ISP address, all
will work fine, since that address is the one that slirp uses to send
the email through. Slirp has some very nice security features, but has
fallen into unsupport the last few years. Its at
http://blitzen.canberra.edu.au/slirp/, but the author has went on to
other things.

-- 

John Conover, 631 Lamont Ct., Campbell, CA., 95008, USA.
VOX 408.370.2688, FAX 408.379.9602, whois '!JC154'
[EMAIL PROTECTED], http://www2.inow.com/~conover/john.html

Reply via email to