Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jun 1998 11:59:46 -0400 (EDT)
From:      Carl Mascott <cmascott@world.std.com>
To:        freebsd-doc@FreeBSD.ORG
Subject:   Contribution to FAQ and Handbook
Message-ID:  <199806081559.LAA00401@europa.my.pc>

next in thread | raw e-mail | index | archive | help
I'm attaching a copy of an article I posted to
comp.unix.bsd.freebsd.misc today.  I suggest that you
do the following:

1.  Add this article as a new FAQ under category
    Networking, subcategory "I can't make ppp work.
    What am I doing wrong?".

2.  Add a reference to this new FAQ in FAQ "Why does
    ppp dial for no reason in -auto mode?".

3.  Modify the FAQ System Administration, "How do I
    set up mail with a dialup connection to the 'net?".
    There are a couple of things wrong with the
    sample .mc file:

    a. The line "FEATURE(allmasquerade)dnl" will
       make it impossible to deliver mail to local aliases.
       This line should be deleted.

    b. The line "define(`confDELIVERY_MODE', `deferred')dnl"
       probably comes from the FAQ "Why does ppp dial for
       no reason in -auto mode?".  Setting the delivery
       mode to "deferred" is not the solution to
       unexpected ppp autodial.  This line is not
       harmful, but it is not useful either.

    c. The line "FEATURE(nodns)dnl" is a no-op in
       sendmail v8.7 and later.  Furthermore,
       there is no need to prevent sendmail from
       using DNS.  This is not the solution to
       unexpected PPP autodial.  See my article.

4.  In the FreeBSD Handbook chapter on PPP and SLIP,
    "Setting up User PPP", "PPP Configuration",
    "PPP and Dynamic IP addresses", add the information
    from my article on using /etc/ppp/ppp.linkdown to
    reset the ifaddr to its original value.


--

HOW TO STOP SENDMAIL FROM NEEDLESSLY TRIGGERING PPP AUTODIAL

AUDIENCE
--------

This information applies to you only if all of the following
are true:

1.  You are using FreeBSD user ppp in autodial mode.
2.  Your machine has a dynamically assigned IP address.
3.  You are using sendmail v8.7 or later (FreeBSD 2.2.6
    has v8.8.8).


PROBLEM
-------

Whenever sendmail sends mail to a user on your own
machine, it triggers autodial and your machine dials
your ISP.


SOLUTION
--------

PART ONE: CONFIGURE SENDMAIL

1.  Create a new sendmail.cf.  You may use the following
    .mc file as a model.  Be sure to change the names.

divert(-1)
#
# sendmail v8 configuration file for dial-up ppp on FreeBSD 2.2.6
#
# 06/08/98  C. Mascott	create file from FreeBSD FAQ112

VERSIONID(`europa.my.pc.mc version 1.0')
OSTYPE(bsd4.4)dnl
FEATURE(nouucp)dnl
MAILER(local)dnl
MAILER(smtp)dnl
Cwlocalhost
Cweuropa.my.pc
MASQUERADE_AS(`world.std.com')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(nocanonify)dnl
define(SMART_HOST, `world.std.com')


Note that this file differs somewhat from the one in
the FAQ.  The differences are intentional.  See the
sendmail doc for more info.

For instructions on how to create a .cf file from a .mc
file, see the following FAQ:

	8.x How do I use sendmail for mail delivery with UUCP?


2.  You must have a file /etc/service.switch, and the
    hosts line of that file must specify "files" before
    "dns".  You may use the following /etc/service.switch
    as a model.

hosts	files dns
aliases	files


3.  Once you have installed the new sendmail.cf and
    service.switch in /etc, kill sendmail and then restart it.


PART TWO: CONFIGURE USER PPP

1.  You must have a file /etc/ppp/ppp.linkdown, and that
    file must have a MYADDR: section which contains the
    same "set ifaddr" line that your /etc/ppp/ppp.conf file
    contains.  You can create this file from
    /etc/ppp/ppp.linkdown.sample.  Here is an example
    MYADDR: section:

MYADDR:
 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0


END OF SOLUTION SECTION


BACKGROUND
----------

This section is optional reading.  It explains why the problem
occurs in the first place, and why the steps above fix it.

Sendmail maintains a list of names by which the local host
is known.  Essentially, it does an "ifconfig -a" internally
and then, for each interface marked UP (except the LOOPBACK
interface), it tries to get the fully qualified domain name
(FQDN) for the local end of the interface.  See
/usr/src/usr.sbin/sendmail/src/conf.c:load_if_names().

After you have been on-line at least once, if you do an
"ifconfig -a", you'll see that the address of the local
end of the tun0 interface is the IP address that your
ISP assigned to your machine the last time that you
were on-line.

Sendmail tries to look up this address, but, of course,
it isn't in /etc/hosts.  Sendmail then tries to use DNS
to look it up.  This is the point at which sendmail
triggers an autodial: it's trying to contact your
ISP's name server.

The procedure above prevents this DNS lookup by doing
two things:

1.  It ensures that, as soon as you go off-line,
    the address of the local end of the tun0 interface
    is reset to the address in /etc/hosts.

2.  It ensures that sendmail checks /etc/hosts before
    attempting a DNS lookup.


THE END

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806081559.LAA00401>