225 lines
4.0 KiB
HTML
225 lines
4.0 KiB
HTML
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Handling email</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.52"><LINK
|
|
REL="HOME"
|
|
TITLE="Linux PPP HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="UP"
|
|
TITLE="After the link comes up - the /etc/ppp/ip-up script"
|
|
HREF="ip-up.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="A sample /etc/ppp/ip-up script"
|
|
HREF="x1455.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Using /etc/ppp/ip-down"
|
|
HREF="c1477.html"></HEAD
|
|
><BODY
|
|
CLASS="SECT1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
><A
|
|
HREF="http://www.linuxports.com/howto/ppp"
|
|
TARGET="_top"
|
|
>Linux PPP HOWTO</A
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x1455.html"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Chapter 25. After the link comes up - the <TT
|
|
CLASS="LITERAL"
|
|
>/etc/ppp/ip-up</TT
|
|
> script</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="c1477.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="SECT1"
|
|
><H1
|
|
CLASS="SECT1"
|
|
><A
|
|
NAME="AEN1464"
|
|
>25.4. Handling email</A
|
|
></H1
|
|
><P
|
|
>The previous section shows how to handle the outgoing mail - simply by
|
|
flushing the mail queue once the link is up.</P
|
|
><P
|
|
>If you are running a WAN link, you can arrange with the network
|
|
administrator of the remote LAN to do exactly the same thing. For
|
|
example, at the Newman Campus end of our WAN link, the
|
|
<TT
|
|
CLASS="LITERAL"
|
|
>/etc/ppp/ip-up</TT
|
|
> script looks like :-</P
|
|
><P
|
|
> <TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
>#!/bin/bash
|
|
#
|
|
# Script which handles the routing issues as necessary for pppd
|
|
# Only the link to Hedland requires this handling.
|
|
#
|
|
# When the ppp link comes up, this script is called with the following
|
|
# parameters
|
|
# $1 the interface name used by pppd (e.g. ppp3)
|
|
# $2 the tty device name
|
|
# $3 the tty device speed
|
|
# $4 the local IP address for the interface
|
|
# $5 the remote IP address
|
|
# $6 the parameter specified by the 'ipparam' option to pppd
|
|
#
|
|
case "$5" in
|
|
203.18.8.4)
|
|
/usr/sbin/sendmail -q
|
|
;;
|
|
*)
|
|
esac
|
|
exit 0</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
> </P
|
|
><P
|
|
>If however you have only a dynamic IP PPP link to your ISP, you need to
|
|
get your email from the account on your ISPs machine. This is usually
|
|
done using the POP (Post Office Protocol). This process can be handled
|
|
using the 'popclient' program - and the ip-up script can automate this
|
|
process for you too!</P
|
|
><P
|
|
>Simply create a <TT
|
|
CLASS="LITERAL"
|
|
>/etc/ppp/ip-up</TT
|
|
> script that contains the
|
|
appropriate invocation of popclient. For my laptop that runs Red Hat Linux
|
|
(which I take on any travels), this is...</P
|
|
><P
|
|
> <TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
>popclient -3 -c -u hartr -p <password> kepler.hedland.edu.au |formail -s procmail</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
> </P
|
|
><P
|
|
>You could use slurp or whatever to do the same for news, and so forth.
|
|
Remember, the ip-up script is just a standard bash script and so can be
|
|
used to automate ANY function that needs to be accomplished every time
|
|
the appropriate PPP link comes up.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x1455.html"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="c1477.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>A sample <TT
|
|
CLASS="LITERAL"
|
|
>/etc/ppp/ip-up</TT
|
|
> script</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="ip-up.html"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Using <TT
|
|
CLASS="LITERAL"
|
|
>/etc/ppp/ip-down</TT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |