From 48525b15aa961d8cce44a4332e86a1e33520b1b6 Mon Sep 17 00:00:00 2001 From: John Fieber Date: Thu, 28 Nov 1996 18:09:30 +0000 Subject: [PATCH] Some new sections. Submitted by: William Lloyd --- share/doc/handbook/Makefile | 14 +- share/doc/handbook/dialout.sgml | 249 +++++++++++++++++++++ share/doc/handbook/dialup.sgml | 4 +- share/doc/handbook/handbook.sgml | 16 +- share/doc/handbook/mail.sgml | 359 +++++++++++++++++++++++++++++++ share/doc/handbook/sections.sgml | 5 +- share/doc/handbook/serial.sgml | 64 ++++++ 7 files changed, 693 insertions(+), 18 deletions(-) create mode 100644 share/doc/handbook/dialout.sgml create mode 100644 share/doc/handbook/mail.sgml create mode 100644 share/doc/handbook/serial.sgml diff --git a/share/doc/handbook/Makefile b/share/doc/handbook/Makefile index a3e2b090a93..bbb0bfe7180 100644 --- a/share/doc/handbook/Makefile +++ b/share/doc/handbook/Makefile @@ -1,15 +1,17 @@ -# $Id: Makefile,v 1.17 1996/09/09 01:56:54 jkh Exp $ +# $Id: Makefile,v 1.18 1996/11/12 08:30:59 asami Exp $ SRCS= authors.sgml basics.sgml bibliography.sgml boothelp.sgml SRCS+= booting.sgml contrib.sgml crypt.sgml ctm.sgml current.sgml -SRCS+= cyclades.sgml development.sgml dialup.sgml +SRCS+= cyclades.sgml development.sgml dialup.sgml dialout.sgml SRCS+= diskless.sgml dma.sgml eresources.sgml esdi.sgml SRCS+= firewalls.sgml glossary.sgml goals.sgml -SRCS+= handbook.sgml history.sgml hw.sgml install.sgml isdn.sgml kerberos.sgml -SRCS+= kernelconfig.sgml kerneldebug.sgml lists.sgml memoryuse.sgml +SRCS+= handbook.sgml history.sgml hw.sgml install.sgml isdn.sgml +SRCS+= kerberos.sgml kernelconfig.sgml kerneldebug.sgml +SRCS+= lists.sgml mail.sgml memoryuse.sgml SRCS+= mirrors.sgml nfs.sgml nutshell.sgml pgpkeys.sgml policies.sgml -SRCS+= porting.sgml ports.sgml ppp.sgml printing.sgml quotas.sgml relnotes.sgml -SRCS+= routing.sgml scsi.sgml sections.sgml sio.sgml skey.sgml slipc.sgml +SRCS+= porting.sgml ports.sgml ppp.sgml printing.sgml +SRCS+= quotas.sgml relnotes.sgml routing.sgml +SRCS+= serial.sgml scsi.sgml sections.sgml sio.sgml skey.sgml slipc.sgml SRCS+= slips.sgml stable.sgml submitters.sgml sup.sgml synching.sgml SRCS+= term.sgml troubleshooting.sgml userppp.sgml uart.sgml linuxemu.sgml diff --git a/share/doc/handbook/dialout.sgml b/share/doc/handbook/dialout.sgml new file mode 100644 index 00000000000..63a62057061 --- /dev/null +++ b/share/doc/handbook/dialout.sgml @@ -0,0 +1,249 @@ + + +Dialout service + +

Information integrated from FAQ. + +The following are tips to getting your host to be able to connect over the modem to another computer. This is appropriate for establishing a terminal session with a remote host. +

This is useful to log onto a BBS. +

This kind of connection can be extremely helpful to get a file on the internet if you have problems with PPP. If you need to ftp something and PPP is broken, use the terminal session to ftp it. Then use zmodem to transfer it to your machine. + + Why cannot I run +

+ On your system, the programs + chmod 4511 /usr/bin/tip + + You do not have to run this command for + My stock Hayes modem is not supported—what can I do? +

+ Actually, the man page for /etc/remote file. + + The Hayes driver is not smart enough to recognize some of the + advanced features of newer modems—messages like /usr/src/usr.bin/tip/tip Obviously you need the source + distribution to do this. + + Edit the line `` + How am I expected to enter these AT commands? +

+ Make what is called a ``/etc/remote file. For example, if your modem's hooked + up to the first serial port, /dev/cuaa0, then put in the + following line: + + cuaa0:dv=/dev/cuaa0:br#19200:pa=none + + Use the highest bps rate your modem supports in the br + capability. Then, type ``/dev/cuaa0 on your system, do this: + + cd /dev + MAKEDEV cuaa0 + +

+ Or use cu as root with the following command: + + cu -l``line'' -s``speed'' + + with line being the serial port (e.g./dev/cuaa0) + and speed being the speed (e.g.57600). + When you are done entering the AT commands hit ~. to exit. + + + The +

+ The /etc/phones for a phone number. But the /etc/remote. Escape it with a backslash: + + pn=\@ + + + + How can I dial a phone number on the command line? +

+ Put what is called a ``/etc/remote file. For example: + + tip115200|Dial any phone number at 115200 bps:\ + :dv=/dev/cuaa0:br#115200:at=hayes:pa=none:du: + tip57600|Dial any phone number at 57600 bps:\ + :dv=/dev/cuaa0:br#57600:at=hayes:pa=none:du: + + + Then you can things like `` + cu115200|Use cu to dial any number at 115200bps:\ + :dv=/dev/cuaa1:br#57600:at=hayes:pa=none:du: + + and type `` + Do I have to type in the bps rate every time I do that? +

+ Put in an entry for + I access a number of hosts through a terminal server. +

+ Rather than waiting until you are connected and typing + ``/etc/remote: + + pain|pain.deep13.com|Forrester's machine:\ + :cm=CONNECT pain\n:tc=deep13: + muffin|muffin.deep13.com|Frank's machine:\ + :cm=CONNECT muffin\n:tc=deep13: + deep13:Gizmonics Institute terminal server:\ + :dv=/dev/cua02:br#38400:at=hayes:du:pa=none:pn=5551234: + + + will let you type `` + Can tip try more than one line for each site? +

+ This is often a problem where a university has several modem lines + and several thousand students trying to use them... +

+ Make an entry for your university in /etc/remote + and use \@ for the + big-university:\ + :pn=\@:tc=dialout + dialout:\ + :dv=/dev/cuaa3:br#9600:at=courier:du:pa=none: + + + Then, list the phone numbers for the university in + /etc/phones: + + big-university 5551111 + big-university 5551112 + big-university 5551113 + big-university 5551114 + + + + Why do I have to hit CTRL+P twice to send CTRL+P once? +

+ CTRL+P is the default ``force'' character, used to tell $HOME/.tiprc + file: + + force= + + + + Suddenly everything I type is in UPPER CASE?? +

+ You must have pressed CTRL+A, + force=^^ + raisechar=^^ + + The ^^ is SHIFT+CTRL+6. + + + How can I do file transfers with +

+ If you are talking to another UNIX system, you can send and + receive files with + ~p [] + ~t [] + + + There is no error checking, so you probably should use another + protocol, like zmodem. + + + How can I run zmodem with +

+ To receive files, start the sending program on the remote end. + Then, type `` diff --git a/share/doc/handbook/dialup.sgml b/share/doc/handbook/dialup.sgml index 29e7b4e9ac2..4f6381c72e7 100644 --- a/share/doc/handbook/dialup.sgml +++ b/share/doc/handbook/dialup.sgml @@ -1,6 +1,6 @@ -Dialup access +Dialin service

Contributed by &a.ghelmer;. diff --git a/share/doc/handbook/handbook.sgml b/share/doc/handbook/handbook.sgml index 4f0366cc986..7c8decc4c47 100644 --- a/share/doc/handbook/handbook.sgml +++ b/share/doc/handbook/handbook.sgml @@ -1,4 +1,4 @@ - + . It may also be downloaded in ascii, LaTeX, postscript or HTML from the or one of the numerous -. +. You may also want to . + - @@ -106,11 +106,11 @@ name="FreeBSD FTP server"> or one of the numerous Network Communications - Basic Networking - * Ethernet basics - * Serial basics + Serial Communications + &serial; &term; &dialup; + &dialout; PPP and SLIP @@ -135,9 +135,7 @@ name="FreeBSD FTP server"> or one of the numerous * Yellow Pages/NIS &isdn; - * Mail - - + &mail; diff --git a/share/doc/handbook/mail.sgml b/share/doc/handbook/mail.sgml new file mode 100644 index 00000000000..9d536668aaa --- /dev/null +++ b/share/doc/handbook/mail.sgml @@ -0,0 +1,359 @@ + + +Electronic Mail +Basic Information + +

Contributed by &a.wlloyd;. + +

E-mail, as simple as the concept sounds, can be extremely complicated. If you plan on doing anything beyond setting up a simple one machine E-mail system, you should buy and refer to a book on Sendmail. + + Introduction +

+ These are the major programs or components of an e-mail exchange. + User program +

This is a program like sendmail or delivering it over TCP to your mailhost. + Transport Agent - Sendmail +

Usually this program is /etc/sysconfig . It is best to leave it on unless you have a specific reason to want it off. Ie: Firewall +

+You should be aware that sendmail is a potential weak link in a secure site. Some versions of sendmail have known security problems. + +

sendmail will look up in the DNS to determine the actual host that will receive mail for the destination. +

Sendmail will take the message from the local queue and deliver it across the internet to another sendmail on the receivers computer. +

Sendmail will also be able to do the reverse. It will accept messages and save them on your local machine. + POP Servers +

This program gets the mail from your mailbox and gives it to your browser. If you want to run a POP server on your computer, you will need to do 2 things. + +Get pop software from the ports or packages collection. +Modify /etc/inetd.conf to load POP server. + + +The pop program you get will have instructions with it. Read them. + +Configuration +

+As your FreeBSD system comes "out of the box" you should be able to send e-mail to external hosts. The problem is no mail will be able to get back to your host. This is not a problem if you are willing to make sure you hand edit the automatic reply to address every time you send a message. +

+It is relatively simple to get another host to receive your e-mail under the same username. You can then pick it up over POP or telnet. + +A user account with the SAME USERNAME should exist on both machines. Please use /nonexistant the user will not be allowed to login. + +The mailhost that you will be using must be designated the Mail exchange for your host. This must be arranged in DNS (ie BIND, named). Please refer to a Networking book for more information. + +You basically need to add these lines in your DNS server. + +myhost.smalliap.com A xxx.xxx.xxx.xxx ; Your ip + MX 10 smtp.smalliap.com ; your mailhost + + +You cannot do this yourself unless you are running a DNS server. If you do not want to run a DNS server, get somebody else like your Internet Provider to do it. + +This will redirect mail for your host to the MX (Mail eXchange) host. It does not matter what machine the A record points to, the mail will be sent to the MX host. +

+This feature is used to implement Virtual Hosting. +

Example +

+I have a customer with domain foo.bar and I want all mail for foo.bar to be sent to my machine smtp.smalliap.com. You must make an entry in your DNS server like: + + +myhost.smalliap.com MX 10 smtp.smalliap.com ; your mailhost + +The A record is not needed if you only want e-mail for the domain. + +On the mailhost that actually accepts mail for final delivery to a mailbox, sendmail must be told what hosts it will be accepting mail for. + +

Add myhost.smalliap.com to /etc/sendmail.cw (if you are using FEATURE(use_cw_file)), or add a "Cw myhost.smalliap.com" line to /etc/sendmail.cf. + +

To actually receive mail on your host, you need to have the MX entry above changed to point to your host. You also move the Cw line above in your sendmail.cf. + +

+This is a Bad Idea if your connection to the internet is not permanent. Mail will bounce. + +

+If you plan on doing anything serious with . + + +FAQ + + Why do I have to use the FQDN for hosts on my site? +

+ You will probably find that the host is actually in a different + domain; for example, if you are in foo.bar.edu and you wish to reach + a host called ``mumble'' in the bar.edu domain, you will have to + refer to it by the fully-qualified domain name, ``mumble.bar.edu'', + instead of just ``mumble''. +

+ Traditionally, this was allowed by BSD BIND resolvers. However + the current version of BIND that ships with FreeBSD + no longer provides default abbreviations for non-fully + qualified domain names other than the domain you are in. + So an unqualified host mumble must either be found + as mumble.foo.bar.edu, or it will be searched for + in the root domain. +

+ This is different from the previous behavior, where the + search continued across mumble.bar.edu, and + mumble.edu. Have a look at RFC 1535 for why this + was considered bad practice, or even a security hole. +

+ As a good workaround, you can place the line +

+search foo.bar.edu bar.edu +

+ instead of the previous + +

+domain foo.bar.edu +

+ into your /etc/resolv.conf. However, make sure + that the search order does not go beyond the ``boundary + between local and public administration'', as RFC 1535 + calls it. + + + + Sendmail says ``mail loops back to myself'' +

+ This is answered in the sendmail FAQ as follows:- + + * I'm getting "Local configuration error" messages, such as: + + 553 relay.domain.net config error: mail loops back to myself + 554 ... Local configuration error + + How can I solve this problem? + + You have asked mail to the domain (e.g., domain.net) to be + forwarded to a specific host (in this case, relay.domain.net) + by using an MX record, but the relay machine doesn't recognize + itself as domain.net. Add domain.net to /etc/sendmail.cw + (if you are using FEATURE(use_cw_file)) or add "Cw domain.net" + to /etc/sendmail.cf. + +

+ The sendmail FAQ is in /usr/src/usr.sbin/sendmail + and is recommended reading if you want to do any + ``tweaking'' of your mail setup. + + + How do I use sendmail for mail delivery with UUCP? + +

+ The sendmail configuration that ships with FreeBSD is + suited for sites that connect directly to the Internet. + Sites that wish to exchange their mail via UUCP must install + another sendmail configuration file. + +

+ Tweaking /etc/sendmail.cf manually is considered + something for purists. Sendmail version 8 comes with a + new approach of generating config files via some m4 + preprocessing, where the actual hand-crafted configuration + is on a higher abstraction level. You should use the + configuration files under + + + /usr/src/usr.sbin/sendmail/cf + + + If you did not install your system with full sources, + the sendmail config stuff has been + broken out into a separate source distribution tarball just + for you. Assuming you have your CD-ROM mounted, do: + + + cd /usr/src + tar -xvzf /cdrom/dists/src/ssmailcf.aa + + + Do not panic, this is only a few hundred kilobytes in size. + The file README in the cf directory can + serve as a basic introduction to m4 configuration. + +

+ For UUCP delivery, you are best advised to use the + mailertable feature. This constitutes a database + that sendmail can use to base its routing decision upon. + +

+ First, you have to create your .mc file. The + directory /usr/src/usr.sbin/sendmail/cf/cf is the + home of these files. Look around, there are already a few + examples. Assuming you have named your file foo.mc, + all you need to do in order to convert it into a valid + sendmail.cf is: + + + cd /usr/src/usr.sbin/sendmail/cf/cf + make foo.cf + cp foo.cf /etc/sendmail.cf + + + A typical .mc file might look like: + + + include(`../m4/cf.m4') + VERSIONID(`Your version number') + OSTYPE(bsd4.4) + + FEATURE(nodns) + FEATURE(nocanonify) + FEATURE(mailertable) + + define(`UUCP_RELAY', your.uucp.relay) + define(`UUCP_MAX_SIZE', 200000) + + MAILER(local) + MAILER(smtp) + MAILER(uucp) + + Cw your.alias.host.name + Cw youruucpnodename.UUCP + + + The nodns and nocanonify features will + prevent any usage of the DNS during mail delivery. The + UUCP_RELAY clause is needed for bizarre reasons, + do not ask. Simply put an Internet hostname there that + is able to handle .UUCP pseudo-domain addresses; most likely, + you will enter the mail relay of your ISP there. + +

+ Once you have this, you need this file called + /etc/mailertable. A typical example of this + gender again: + + + # + # makemap hash /etc/mailertable.db < /etc/mailertable + # + horus.interface-business.de uucp-dom:horus + .interface-business.de uucp-dom:if-bus + interface-business.de uucp-dom:if-bus + .heep.sax.de smtp8:%1 + horus.UUCP uucp-dom:horus + if-bus.UUCP uucp-dom:if-bus + . uucp-dom:sax + + + As you can see, this is part of a real-life file. The first + three lines handle special cases where domain-addressed mail + should not be sent out to the default route, but instead to + some UUCP neighbor in order to ``shortcut'' the delivery + path. The next line handles mail to the local Ethernet + domain that can be delivered using SMTP. Finally, the UUCP + neighbors are mentioned in the .UUCP pseudo-domain notation, + to allow for a ``uucp-neighbor!recipient'' override of the + default rules. The last line is always a single dot, matching + everything else, with UUCP delivery to a UUCP neighbor that + serves as your universal mail gateway to the world. All of + the node names behind the uucp-dom: keyword must + be valid UUCP neighbors, as you can verify using the + command uuname. + +

+ As a reminder that this file needs to be converted into a + DBM database file before being usable, the command line to + accomplish this is best placed as a comment at the top of + the mailertable. You always have to execute this command + each time you change your mailertable. + +

+ Final hint: if you are uncertain whether some particular + mail routing would work, remember the -bt option to + sendmail. It starts sendmail in address test mode; + simply enter ``0 '', followed by the address you wish to + test for the mail routing. The last line tells you the used + internal mail agent, the destination host this agent will be + called with, and the (possibly translated) address. Leave + this mode by typing Control-D. + + + j@uriah 191% sendmail -bt + ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) + Enter

+ > 0 foo@interface-business.de + rewrite: ruleset 0 input: foo @ interface-business . de + ... + rewrite: ruleset 0 returns: $# uucp-dom $@ if-bus $: foo \ + < @ interface-business . de > + > ^D + j@uriah 192% + + +How can I do e-mail with a dialup PPP host +

+You want to connect a FreeBSD box on a lan, to the internet. The FreeBSD box will be a mail gateway for the lan. The PPP connection is non-dedicated. + +There are at least two way to do this. + +The other is to use UUCP. + +The key is to get a internet site to provide secondary MX services for your domain. +For example: + +bigco.com. MX 10 bigco.com. + MX 20 smalliap.com. + + +Only one host should be specified as the final recipient ( add ``Cw bigco.com'' in /etc/sendmail.cf on bigco.com). + +When the senders sendmail is trying to deliver the mail it will try to connect to you over the modem link. It will most likely time out because you are not online. Sendmail will automatically deliver it to the secondary MX site, ie your internet provider. The secondary MX site will try every (sendmail_flags = "-bd -q15m" in /etc/sysconfig ) 15 minutes to connect to your host to deliver the mail to the primary MX site. + +You might wat to use something like this as a login script. + +#!/bin/sh +# Put me in /usr/local/bin/pppbigco +( sleep 60 ; /usr/sbin/sendmail -q ) & +/usr/sbin/ppp -direct pppbigco + +If you are going to create a seperate login script for a user you could use sendmail -qRbigco.com instead in the script above. This will force all mail in your queue for bigco.com to be processed immediately. + + +A further refinement of the situation is as follows. + +Message stolen from the freebsd-isp mailing list. + +> we provide the secondary mx for a customer. The customer connects to +> our services several times a day automatically to get the mails to +> his primary mx (We do not call his site when a mail for his domains +> arrived). Our sendmail sends the mailqueue every 30 minutes. At the +> moment he has to stay 30 minutes online to be sure that all mail is +> gone to the primary mx. +> +> Is there a command that would initiate sendmail to send all the mails +> now? The user has not root-privileges on our machine of course. + +In the 'privacy flags' section of sendmail.cf, there is a definition +Opgoaway,restrictqrun + +Remove restrictqrun to allow non-root users to start the queue processing. +You might also like to rearrange the MXs. We are the 1st MX for our +customers like this, and we have defined: + +# If we are the best MX for a host, try directly instead of generating +# local config error. +OwTrue + +That way a remote site will deliver straight to you, without trying +the customer connection. You then send to your customer. Only works for +'hosts', so you need to get your customer to name their mail machine +'customer.com' as well as 'hostname.customer.com' in the DNS. Just put +an A record in the DNS for 'customer.com'. + + + diff --git a/share/doc/handbook/sections.sgml b/share/doc/handbook/sections.sgml index 38e246a6515..d9978beb069 100644 --- a/share/doc/handbook/sections.sgml +++ b/share/doc/handbook/sections.sgml @@ -1,4 +1,4 @@ - + @@ -14,6 +14,7 @@ + @@ -30,6 +31,7 @@ + @@ -43,6 +45,7 @@ + diff --git a/share/doc/handbook/serial.sgml b/share/doc/handbook/serial.sgml new file mode 100644 index 00000000000..82f83136f47 --- /dev/null +++ b/share/doc/handbook/serial.sgml @@ -0,0 +1,64 @@ + + +Serial Basics + +

Assembled from FAQ. + +This section should give you some general information about serial ports. If you do not find what you want here, check into the Terminal and Dialup sections of the handbook. + + +

+ The + stty -a -f /dev/ttyd1 + + + When you change the settings to this device, the settings are in + effect until the device is closed. When it is reopened, it goes + back to the default set. To make changes to the default set, you + can open and adjust the settings of the ``initial state'' device. + For example, to turn on XON/XOFF flow control by default for ttyd5, do: + + stty -f /dev/ttyid5 clocal cs8 ixon ixoff + + + A good place to do this is in /etc/rc.serial. Now, an + application will have these settings by default when it opens + + stty -f /dev/ttyld5 57600 + + + Now, an application that opens