old-www/HOWTO/ISP-Hookup-HOWTO-4.html

204 lines
6.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>ISP-Hookup-HOWTO: How do I send and receive email</TITLE>
<LINK HREF="ISP-Hookup-HOWTO-5.html" REL=next>
<LINK HREF="ISP-Hookup-HOWTO-3.html" REL=previous>
<LINK HREF="ISP-Hookup-HOWTO.html#toc4" REL=contents>
</HEAD>
<BODY>
<A HREF="ISP-Hookup-HOWTO-5.html">Next</A>
<A HREF="ISP-Hookup-HOWTO-3.html">Previous</A>
<A HREF="ISP-Hookup-HOWTO.html#toc4">Contents</A>
<HR>
<H2><A NAME="s4">4. How do I send and receive email</A></H2>
<P>First of all, ensure that
<!--
sendmail
-->
sendmail is installed. Sendmail sorts internal and
out-bound mail, and will buffer out-bound mail until such time it
is possible to forward it.
<P>Sendmail is based on a configuration found in
<!--
/etc/sendmail.cf
-->
/etc/sendmail.cf. An
example suitable for ISP users can be found in:
<P><CODE>
<A HREF="ftp://ftp.sol.no/user/egilk/sendmail.cf">ftp://ftp.sol.no/user/egilk/sendmail.cf</A></CODE>
This is based on
<!--
procmail
-->
procmail as a
delivery agent but may easily be changed to use
<!--
deliver
-->
deliver.
<P>It is if course required to have an <B>official</B> domain
address for out-bound mail, something which is specified in
<!--
sendmail.cf
-->
sendmail.cf:
<BLOCKQUOTE><CODE>
<PRE>
# who I masquerade as (null for no masquerading)
DMacme.xz
</PRE>
</CODE></BLOCKQUOTE>
<!--
DM
-->
<!--
masquerading
-->
This assumes that you
have the same user name locally as you have at your ISP. If it is
different, just specify the full name instead:
<BLOCKQUOTE><CODE>
<PRE>
DMdick@acme.xz
</PRE>
</CODE></BLOCKQUOTE>
Sendmail is now configured for sending <B>directly</B> to the
recipient. To avoid long and repeated connections in those cases
where the connection to the receiving end is slow and irregular,
is is usually nice to use ones ISP as a buffer store. This can
be specified by the DS specification:
<BLOCKQUOTE><CODE>
<PRE>
# "Smart" relay host (may be null)
DSmail.acme.xz
</PRE>
</CODE></BLOCKQUOTE>
Beware that sendmail is somewhat sensitive to handling of tab
stop characters in
<!--
sendmail.cf
-->
sendmail.cf. You might want to use the
<!--
vi
-->
vi editor to ensure that these tab
characters are retained unchanged.
<P>Email reception can often be performed via the POP3
protocol, which can be initiated every time the connection is
brought up. A script for testing this is:
<BLOCKQUOTE><CODE>
<PRE>
sendmail -q
popclient -3 -v mail.acme.xz -u dirk -p "PrettySecret" \
-k -o /usr/spool/mail/dirk
</PRE>
</CODE></BLOCKQUOTE>
<!--
popclient
-->
This script may be started after PPP
connection has been established. Beware that this script is just
for testing, so ensure that the local mailbox is left untouched
while it runs. The <CODE>-k</CODE> option means that the mail is
<B>kept</B> in the ISP mailbox, and you are simply given a copy
of the mail. You would of course want to remove this option once
you are confident that your setup is working.
<P>Beware that the password will show on the command line. Also
note that popclient is getting old fashioned, and that you should
consider using
<!--
fetchmail
-->
fetchmail
instead.
<P>A more secure and better version of this script may be found at:
<P><CODE>
<A HREF="ftp://ftp.sol.no/user/egilk/pop-script.tar.gz">ftp://ftp.sol.no/user/egilk/pop-script.tar.gz</A></CODE>
<P>This version of the script requires that
<!--
procmail
-->
procmail is installed, but that is something you'll
never regret anyway. Most distributions include it, otherwise you
may try:
<P><CODE>
<A HREF="ftp://sunsite.unc.edu/pub/Linux/system/Mail/mailhandlers/procmail-3.10-2.tar.gz">ftp://sunsite.unc.edu/pub/Linux/system/Mail/mailhandlers/procmail-3.10-2.tar.gz</A></CODE>
<P>Procmail is a simple and flexible tool that can sort incoming
email based on a large range of criteria. In addition to being
able to handle automated tasks like vacation messages
and such.
<P>Note that when we use procmail directly as in this case, the
situation is somewhat different from what is described in the
procmail documentation. A .forward is <B>not</B>
required, and we also don't need a .procmailrc. The
latter is only required if we want to sort the mail.
<P>The user interface for reading and sending of email can be found
in programs like
<!--
pine
-->
pine or
<!--
elm
-->
elm.
<P><B>ALT:</B> Fetchmail has recently become an
improved alternative to popclient. The latest version is
available from:
<P><CODE>
<A HREF="ftp://ftp.ccil.org/pub/esr/fetchmail/fetchmail-3.3.tar.gz">ftp://ftp.ccil.org/pub/esr/fetchmail/fetchmail-3.3.tar.gz</A></CODE>
<P><B>ALT:</B> For an ordinary dial-up ISP user it is not really
necessary to have the sendmail daemon
active. To reduce resource usage, and possibly other problems,
one may thus comment out any startup of sendmail, as is usually
found in /etc/rc.d/rc.M (this varies from
distribution to distribution).
<P><B>ALT:</B> In place of sendmail one might use the simpler
<!--
smail
-->
smail. You'll find a good
description of it (as well as most other things mentioned here)
in the <I>Linux Network Administrator's Guide</I>.
<P><B>ALT:</B> There is also an m4 macro package for
making a fresh
<!--
/etc/sendmail.cf
-->
/etc/sendmail.cf. For a simple installation it
might be just as well to modify an existing configuration.
<P><B>ALT:</B> There are also simpler although less flexible
alternatives for handling email. Pine may run
stand-alone as long as it is configured properly, for instance.
It might even be possible to use newer versions of some
web-browsers.
<P><B>ALT:</B> Many are very enthusiastic regarding the Emacs
companion Gnus as an email and news handler. Further
information can be found at:
<P><CODE>
<A HREF="http://www.ifi.uio.no/~larsi/">http://www.ifi.uio.no/~larsi/</A></CODE>
<P><B>ALT:</B> An alternative to popclient is
pop-perl5. It is available from:
<P><CODE>
<A HREF="ftp://sunsite.unc.edu/pub/Linux/System/Mail/pop-perl5-1.1.tar.gz">ftp://sunsite.unc.edu/pub/Linux/System/Mail/pop-perl5-1.1.tar.gz</A></CODE>
<P>
<HR>
<A HREF="ISP-Hookup-HOWTO-5.html">Next</A>
<A HREF="ISP-Hookup-HOWTO-3.html">Previous</A>
<A HREF="ISP-Hookup-HOWTO.html#toc4">Contents</A>
</BODY>
</HTML>