Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jul 2003 16:21:44 -0400
From:      "Dan Langille" <dan@langille.org>
To:        freebsd-questions@FreeBSD.org
Cc:        fbsd_user <fbsd_user@a1poweruser.com>
Subject:   RE: configuring dial-up for extreme novices (i.e. Mom).
Message-ID:  <3F142A18.11853.2FA71FFE@localhost>
In-Reply-To: <MIEPLLIBMLEEABPDBIEGMELFEBAA.fbsd_user@a1poweruser.com>
References:  <3F12FCAF.20829.2B0D76E8@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
On 15 Jul 2003 at 11:36, fbsd_user wrote:

> > My mom has been using FreeBSD via DSL for some time.  I'm about to
> > move her to dial up.  I'm going to use userland ppp and postfix.
> > 
> > My initial untested idea is to create a script for her which will:
> > - ppp --dial HerISP,
> > - wait for the connection to come up
> > - then flush the mail queue
> > - run fetchmail to grab anything waiting
> > - kill the connection
> > 
> > Anyone already done this?  Any suggestions?

> Yes you can do what you have described. User ppp has a mode that
> will not dial out until network services are needed by user. Give
> your Mom a script to run which will start fetchmail, user ppp will
> automatically start and call your ISP and connect, fetchmail will
> complete. Then have commands in script to kill fetchmail and user
> ppp, and start Mutt to read mail from postfix.

Here is what I set up this morning.  My mum uses only email, and 
doesn't surf the web.  So dial on demand wasn't something I wanted to 
try.  So I took this approach:

pkg_add -r postfix
pkg_add -r sudo

alter /usr/local/etc/postfix/main.cf to have:
relayhost = smtp.myisp.com

alter /etc/ppp/ppp.conf to have this within the myisp section:
   set server /var/run/istop "" 0177

create a dial script for mum:

run visudo to add this:
mum   ALL = NOPASSWD: /usr/local/sbin/postfix flush
mum   ALL = NOPASSWD: /usr/sbin/ppp -quiet -background myisp
mum   ALL = NOPASSWD: /bin/kill -TERM `cat /var/run/tun1.pid`
mum   ALL = NOPASSWD: /usr/sbin/pppctl /var/run/myisp quit all

Create a "dial" script:
#!/bin/sh
sudo /usr/sbin/ppp -quiet -background myisp
sudo /usr/local/sbin/postfix flush
fetchmail
sudo /usr/sbin/pppctl /var/run/myisp quit all

Create ~/.fetchmailrc:

poll 127.0.0.1 port 12346 with proto apop:
    preconnect "ssh -f -L 12346:my.mail.example.org:110    
    mum@mail.example.org sleep 40 </dev/null >/dev/null"
    password secret;

In this case, all of mum's email goes to my mail server, and sits 
there waiting for her to pop it off.  This is done via fetchmail.

So after Mum types her email and "sends" it, she exits pine, then 
issues the "dial" command.  I'm going to add some error checking to 
the above "dial" script.  Especially to check that ppp connects.

Any suggestions?

FWIW: she's not yet using this as we're waiting for her dial-up 
account to be set up but I've tested it using her DSL provider's dial 
up line.
-- 
Dan Langille : http://www.langille.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F142A18.11853.2FA71FFE>