From 576821edfc0a1671bf9b63a120237ee55ee5df88 Mon Sep 17 00:00:00 2001 From: Mike Pritchard Date: Fri, 10 Jan 1997 07:02:43 +0000 Subject: [PATCH] Various changes submitted by the original author. Closes PR# 2372. Reviewed by: The spelling police Submitted by: William Lloyd --- share/doc/handbook/mail.sgml | 295 ++++++++++++++++++++++------------- 1 file changed, 183 insertions(+), 112 deletions(-) diff --git a/share/doc/handbook/mail.sgml b/share/doc/handbook/mail.sgml index bac06b1f825d..d2c7774ede4f 100644 --- a/share/doc/handbook/mail.sgml +++ b/share/doc/handbook/mail.sgml @@ -1,4 +1,4 @@ - 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. +

Electronic Mail configuration is the subject of many books. If you plan on doing anything beyond setting up one mailhost for your network, you need industrial strength help. + +Some parts of E-Mail configuration are controlled in the Domain Name System (DNS). If you are going to run your own own DNS server check out /etc/namedb and ' man -k named ' for more information. + +Basic Information - 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 + These are the major programs involved in an E-Mail exchange. +A User program +

This is a program like sendmail or delivering it over TCP. + + Mailhost Server Daemon +

Usually this program is /etc/sysconfig . It is best to leave it on, unless you have a specific reason to want it off. Example: You are building a . + +

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

sendmail does two jobs. It looks after delivering and receiving mail. + +If needs to delivery mail off your site it will look up in the DNS to determine the actual host that will receive mail for the destination. + +

If it is acting as a delivery agent DNS - Name Service +

The Domain Name System and its daemon 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. +Get pop software from the that can be found in /usr/ports + or packages collection. This handbook section has a complete reference on the system. +Modify /etc/inetd.conf to load the 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. +The pop program will have instructions with it. Read them. -A user account with the SAME USERNAME should exist on both machines. Please use /nonexistent 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. +Configuration + + Basic +

+As your FreeBSD system comes "out of the box"[TM], you should be able to send E-mail to external hosts as long as you have /etc/resolv.conf setup or are running a name server. + If you want to have mail for your host delivered to your specific host,there are two methods: +

+- Run a name server ( man -k named ) and have your own domain smallminingco.com +

+- Get mail delivered to the current DNS name for your host. Ie: dorm6.ahouse.school.edu +

+No matter what option you choose, to have mail delivered directly to your host, you must be a full Internet host. You must have a permanent IP address. IE: NO dynamic PPP. If you are behind a firewall, the firewall must be passing on smtp traffic to you. From /etc/services + +smtp 25/tcp mail #Simple Mail Transfer + +If you want to receive mail at your host itself, you must make sure that the DNS MX entry points to your hosts address, or there is no MX entry for your DNS name. + +Try this + +newbsdbox# hostname +newbsdbox.freebsd.org +newbsdbox# host newbsdbox.freebsd.org +newbsdbox.freebsd.org has address 204.216.27.xx + + +If that is all that comes out for your machine, mail directory to root@newbsdbox.freebsd.org will work no problems. + +If instead, you have this + +newbsdbox# host newbsdbox.freebsd.org +newbsdbox.FreeBSD.org has address 204.216.27.xx +newbsdbox.FreeBSD.org mail is handled (pri=10) by freefall.FreeBSD.org + +All mail sent to your host directly will end up on freefall, under the same username. + +This information is setup in your domain name server. This should be the same host that is listed as your primary nameserver in /etc/resolv.conf + +The DNS record that carries mail routing information is the Mail eXchange entry. If no MX entry exists, mail will be delivered directly to the host by way of the Address record. + +The MX entry for freefall.freebsd.org at one time. + + freefall MX 30 mail.crl.net + freefall MX 40 agora.rdrop.com + freefall HINFO Pentium FreeBSD + freefall MX 10 freefall.FreeBSD.org + freefall MX 20 who.cdrom.com + freefall A 204.216.27.xx + freefall CNAME www.FreeBSD.org + + +freefall has many MX entries. The lowest MX number gets the mail in the end. The others will queue mail temporarily, if freefall is busy or down. + +Alternate MX sites should have separate connections to the Internet, to be most useful. An Internet Provider or other friendly site can provide this service. + +dig, nslookup, and host are your friends. + + Mail for your Domain (Network). +

+To setup up a network mailhost, you need to direct the mail from arriving at all the workstations. In other words, you want to hijack all mail for *.smallminingco.com and divert it to one machine, your mailhost. + +The network users on their workstations will most likely pick up their mail over POP or telnet. + +A user account with the SAME USERNAME should exist on both machines. Please use /nonexistent the user will not be allowed to login. + +The mailhost that you will be using must be designated the Mail eXchange for each workstation. This must be arranged in DNS (ie BIND, named). Please refer to a Networking book for in-depth 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 - + +pc24.smallminingco.com A xxx.xxx.xxx.xxx ; Workstation ip + MX 10 smtp.smallminingco.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 will redirect mail for the workstation to the 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. +This feature is used to implement Virtual E-Mail 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: - -foo.bar MX 10 smtp.smalliap.com ; your mailhost +foo.bar MX 10 smtp.smalliap.com ; your mailhost -The A record is not needed if you only want e-mail for the domain. +The A record is not needed if you only want E-Mail for the domain. IE: Don't expect ping foo.bar to work unless an Address record for foo.bar exists as well. 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. - +

Add pc24.smallminingco.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

-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 am 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 does not 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? +If you plan on doing anything serious with . + + + Setting up UUCP. +

Stolen from the FAQ.

The sendmail configuration that ships with FreeBSD is suited for sites that connect directly to the Internet. @@ -294,8 +297,76 @@ domain foo.bar.edu > ^D j@uriah 192% + -How can I do e-mail with a dialup PPP host +FAQ + +

Migration from 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 am 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 does not 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 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.