From owner-freebsd-questions@FreeBSD.ORG Tue Jul 15 13:21:50 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A367237B413 for ; Tue, 15 Jul 2003 13:21:50 -0700 (PDT) Received: from bast.unixathome.org (bast.unixathome.org [66.11.174.150]) by mx1.FreeBSD.org (Postfix) with ESMTP id F1AE543FAF for ; Tue, 15 Jul 2003 13:21:49 -0700 (PDT) (envelope-from dan@langille.org) Received: from wocker (wocker.unixathome.org [192.168.0.99]) by bast.unixathome.org (Postfix) with ESMTP id 8F2F03D28; Tue, 15 Jul 2003 16:21:44 -0400 (EDT) From: "Dan Langille" To: freebsd-questions@FreeBSD.org Date: Tue, 15 Jul 2003 16:21:44 -0400 MIME-Version: 1.0 Message-ID: <3F142A18.11853.2FA71FFE@localhost> Priority: normal In-reply-to: References: <3F12FCAF.20829.2B0D76E8@localhost> X-mailer: Pegasus Mail for Windows (v4.02a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body cc: fbsd_user Subject: RE: configuring dial-up for extreme novices (i.e. Mom). X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 20:21:51 -0000 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" 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/