From owner-svn-doc-projects@FreeBSD.ORG Mon Apr 15 15:03:48 2013 Return-Path: Delivered-To: svn-doc-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CAFF710; Mon, 15 Apr 2013 15:03:48 +0000 (UTC) (envelope-from dru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3ECCA78C; Mon, 15 Apr 2013 15:03:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FF3m0t060117; Mon, 15 Apr 2013 15:03:48 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FF3m3X060116; Mon, 15 Apr 2013 15:03:48 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201304151503.r3FF3m3X060116@svn.freebsd.org> From: Dru Lavigne Date: Mon, 15 Apr 2013 15:03:48 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-projects@freebsd.org Subject: svn commit: r41433 - projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/mail X-SVN-Group: doc-projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for doc projects trees List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 15:03:48 -0000 Author: dru Date: Mon Apr 15 15:03:47 2013 New Revision: 41433 URL: http://svnweb.freebsd.org/changeset/doc/41433 Log: Initial patch which fixes the following. Subsequent patches will follow. - fixes &os;, e-mail, and directory tags - fixes acronyms - reworded to remove you, please, simply - inetd reference removed - modernized the host output - grammo fixes - remove non-existing ports (devel) - remove UUCP section Reviewed by: gjb (mentor) Modified: projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/mail/chapter.xml Modified: projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/mail/chapter.xml ============================================================================== --- projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/mail/chapter.xml Mon Apr 15 15:00:34 2013 (r41432) +++ projects/ISBN_1-57176-407-0/en_US.ISO8859-1/books/handbook/mail/chapter.xml Mon Apr 15 15:03:47 2013 (r41433) @@ -35,23 +35,22 @@ one of the most widely used forms of communication today. This chapter provides a basic introduction to running a mail server on &os;, as well as an introduction to sending and - receiving email using &os;; however, it is not a complete - reference and in fact many important considerations are omitted. - For more complete coverage of the subject, the reader is - referred to the many excellent books listed in + receiving email using &os;. + For more complete coverage of this subject, + refer to the books listed in . After reading this chapter, you will know: - What software components are involved in sending and + Which software components are involved in sending and receiving electronic mail. Where basic sendmail - configuration files are located in FreeBSD. + configuration files are located in &os;. @@ -60,13 +59,13 @@ - How to block spammers from illegally using your mail + How to block spammers from illegally using a mail server as a relay. How to install and configure an alternate Mail Transfer - Agent on your system, replacing + Agent, replacing sendmail. @@ -75,10 +74,6 @@ - How to use SMTP with UUCP. - - - How to set up the system to send mail only. @@ -87,18 +82,18 @@ - How to configure SMTP Authentication for added + How to configure SMTP authentication for added security. How to install and use a Mail User Agent, such as - mutt to send and receive + mutt, to send and receive email. - How to download your mail from a remote + How to download mail from a remote POP or IMAP server. @@ -113,18 +108,20 @@ - Properly set up your network connection - (). + Properly set up a network + connection. - Properly set up the DNS information for your mail host - (). + Properly set up the DNS + information for a mail host. - Know how to install additional third-party software - (). + Know how to install additional + third-party software. @@ -136,41 +133,42 @@ IMAP DNS - There are five major parts involved in an email exchange. - They are: the user program, - the server daemon, DNS, a - remote or local mailbox, and of course, the mailhost itself. + There are five major parts involved in an email exchange: + the Mail User Agent + MUA>, the + Mail Transfer AgentMTA, DNS, a remote or local mailbox, and + the mail host. - The User Program + The Mail User Agent This includes command line programs such as mutt, alpine, elm, and - mail, and GUI - programs such as balsa, - xfmail to name a few, and something - more sophisticated like a WWW browser. These - programs simply pass off the email transactions to the local - mailhost, - either by calling one of the server - daemons available, or delivering it over - TCP. + mail, GUI programs such + as balsa or + xfmail, and web mail programs + which can be accessed from a web browser. User programs pass + the email transactions to the local mail host, either + by a MTA, or by + delivering it over TCP. - Mailhost Server Daemon + The Mail Transfer Agent mail server daemons - sendmail + Sendmail mail server daemons - postfix + Postfix mail server daemons @@ -178,20 +176,22 @@ mail server daemons - exim + Exim - &os; ships with sendmail by - default, but also support numerous other mail server daemons, - just some of which include: + &os; ships with +Sendmail as the default + MTA, but it also supports numerous other +mail server daemons, + including: - exim; + Exim; - postfix; + Postfix; @@ -199,21 +199,23 @@ - The server daemon usually has two functions—it is + The MTA usually has two +functions. It is responsible for receiving incoming mail as well as delivering outgoing mail. It is not responsible for the collection of mail using protocols such as - POP or IMAP to read - your email, nor does it allow connecting to local - mbox or Maildir mailboxes. You may - require an additional daemon for that. + POP or IMAP, nor does it +allow connecting to local + mbox or Maildir mailboxes. An additional +daemon may be required for + these functions. - Older versions of sendmail - have some serious security issues which may result in an - attacker gaining local and/or remote access to your machine. - Make sure that you are running a current version to avoid + Older versions of Sendmail + contain serious security issues which may result in an + attacker gaining local or remote access to the system. + Run a current version to &os; to avoid these problems. Optionally, install an alternative MTA from the &os; Ports Collection. @@ -223,13 +225,15 @@ Email and DNS - The Domain Name System (DNS) and its daemon + The Domain Name System (DNS) and its +daemon named play a large role in the delivery - of email. In order to deliver mail from your site to another, - the server daemon will look up the remote site in the DNS - to determine the host that will receive mail for the + of email. In order to deliver mail from one site to another, + the MTA will look up the remote site in +DNS + to determine which host will receive mail for the destination. This process also occurs when mail is sent from - a remote host to your mail server. + a remote host to the MTA. MX record @@ -237,18 +241,22 @@ DNS is responsible for mapping hostnames to IP addresses, as well as for storing information - specific to mail delivery, known as MX records. The MX (Mail - eXchanger) record specifies which host, or hosts, will receive - mail for a particular domain. If you do not have an MX record - for your hostname or domain, the mail will be delivered - directly to your host provided you have an A record pointing - your hostname to your IP address. - - You may view the MX records for any domain by using the - &man.host.1; command, as seen in the example below: + specific to mail delivery, known as Mail eXchanger ++ MX records. The MX +record specifies which host, or hosts, will receive + mail for a particular domain. If there is no +MX record + for the hostname or domain, the mail will be delivered + directly to the host, provided there is an +A record pointing + the hostname to the IP address. + + To view the MX records for a domain, +specify the type of record using + &man.host.1;, as seen in the example below: &prompt.user; host -t mx FreeBSD.org -FreeBSD.org mail is handled (pri=10) by mx1.FreeBSD.org +FreeBSD.org mail is handled by 10 mx1.FreeBSD.org @@ -259,33 +267,33 @@ FreeBSD.org mail is handled (pri=10) by receiving - Receiving mail for your domain is done by the mail host. - It will collect all mail sent to your domain and store it - either in mbox (the default method for - storing mail) or Maildir format, depending on your + Receiving mail for a domain is done by the mail host. + It will collect all mail sent to the domain and store it + either in the default mbox or the +alternative Maildir format, depending on the configuration. Once mail has been stored, it may either be - read locally using applications such as &man.mail.1; or - mutt, or remotely accessed and + read locally using a + MUA, or remotely accessed and collected using protocols such as POP or - IMAP. This means that should you only - wish to read mail locally, you are not required to install + IMAP. In order to read mail locally, a POP or IMAP - server. + server does not need to be installed. - Accessing remote mailboxes using <acronym>POP</acronym> + <title>Accessing Remote Mailboxes Using <acronym>POP</acronym> and <acronym>IMAP</acronym> POP IMAP - In order to access mailboxes remotely, you are required - to have access to a POP or - IMAP server. These protocols allow users - to connect to their mailboxes from remote locations with - ease. Though both POP and + To access mailboxes remotely, access to a +POP or + IMAP server is required. These protocols +allow users + to connect to their mailboxes from remote locations. Though +both POP and IMAP allow users to remotely access mailboxes, IMAP offers many advantages, - some of which are: + including: @@ -299,9 +307,9 @@ FreeBSD.org mail is handled (pri=10) by - IMAP can be extremely useful over + IMAP can be useful over low-speed links as it allows users to fetch the - structure of messages without downloading them; it can + structure of messages without downloading them. It can also perform tasks such as searching on the server in order to minimize data transfer between clients and servers. @@ -315,70 +323,74 @@ FreeBSD.org mail is handled (pri=10) by - Choose an IMAP or - POP server that best suits your - needs. The following POP and - IMAP servers are well known and serve - as some good examples: + Use the Ports Collection to install an +IMAP or + POP server. The following +POP and + IMAP servers are well known: - qpopper; + mail/qpopper - teapop; + mail/teapop - imap-uw; + mail/imap-uw - courier-imap; + mail/courier-imap - dovecot; + mail/dovecot2 - Install the POP or - IMAP daemon of your choosing from - the ports collection. - - - - Where required, modify - /etc/inetd.conf to load the + Where required, use the startup script that came + with the application to load the POP or IMAP - server. + server. Those programs will also provide a variable + which can be added to /etc/rc.conf + to automate the startup of the application's daemon + whenever the system boots. It should be noted that both POP and IMAP transmit information, - including username and password credentials in clear-text. - This means that if you wish to secure the transmission - of information across these protocols, you should consider - tunneling sessions over &man.ssh.1; or using SSL. - Tunneling sessions is described in - and SSL is - described in . + including username and password credentials, in +clear-text. + To secure the transmission + of information across these protocols, consider + tunneling sessions over +&man.ssh.1; or using SSL.. Accessing Local Mailboxes - Mailboxes may be accessed locally by directly utilizing - MUAs on the server on which the mailbox - resides. This can be done using applications such as - mutt or &man.mail.1;. + Mailboxes may be accessed locally by directly using an + MUA on the server on which the mailbox + resides. This can be done using a built-in application +such as &man.mail.1; or by installing a + MUA from the Ports Collection.. @@ -387,9 +399,9 @@ FreeBSD.org mail is handled (pri=10) by mail host - The mail host is the name given to a server that is - responsible for delivering and receiving mail for your host, - and possibly your network. + The mail host is a server that is + responsible for delivering and receiving mail for a host, + or a network. @@ -403,22 +415,24 @@ FreeBSD.org mail is handled (pri=10) by - <application>sendmail</application> Configuration + <application>Sendmail</application> Configuration - sendmail + Sendmail - &man.sendmail.8; is the default Mail Transfer Agent (MTA) - in FreeBSD. sendmail's job is to - accept mail from Mail User Agents (MUA) and - deliver it to the appropriate mailer as defined by its - configuration file. sendmail can + &man.sendmail.8; is the default MTA + which is installed with &os;. +Sendmail + accepts mail from MUAs and + delivers it to the appropriate mailer as defined by its + configuration file. Sendmail can also accept network connections and deliver mail to local - mailboxes or deliver it to another program. + mailboxes or to another program. - sendmail uses the following - configuration files: + Sendmail uses the following + configuration files. This section describes these files in more + detail. /etc/mail/access @@ -453,8 +467,8 @@ FreeBSD.org mail is handled (pri=10) by /etc/mail/access - sendmail access database - file + Sendmail access database + file. @@ -466,33 +480,33 @@ FreeBSD.org mail is handled (pri=10) by /etc/mail/local-host-names - Lists of hosts sendmail - accepts mail for + Lists of hosts Sendmail + accepts mail for. /etc/mail/mailer.conf - Mailer program configuration + Mailer program configuration. /etc/mail/mailertable - Mailer delivery table + Mailer delivery table. /etc/mail/sendmail.cf - sendmail master - configuration file + Sendmail master + configuration file. /etc/mail/virtusertable - Virtual users and domain tables + Virtual users and domain tables. @@ -501,22 +515,23 @@ FreeBSD.org mail is handled (pri=10) by <filename>/etc/mail/access</filename> - The access database defines what host(s) or IP addresses + This database defines which host(s) or IP addresses have access to the local mail server and what kind of access they have. Hosts can be listed as , - , or simply - passed to sendmail's error + , or , or can be + passed to Sendmail's error handling routine with a given mailer error. Hosts that - are listed as , which is the default, + are listed as , which is the default +option, are allowed to send mail to this host as long as the mail's final destination is the local machine. Hosts that are listed as are rejected for all mail - connections. Hosts that have the - option for their hostname are allowed to send mail for any - destination through this mail server. + connections. Hosts that are listed as + are allowed to send mail for any + destination using this mail server. - Configuring the <application>sendmail</application> + <title>Configuring the <application>Sendmail</application> Access Database cyberspammer.com 550 We do not accept mail from spammers @@ -526,36 +541,37 @@ okay.cyberspammer.com OK 128.32 RELAY - In this example we have five entries. Mail senders that - match the left hand side of the table are affected by the + This example shows five entries. Mail senders that + match the left side of the table are affected by the action on the right side of the table. The first two examples - give an error code to sendmail's - error handling routine. The message is printed to the remote - host when a mail matches the left hand side of the table. - The next entry rejects mail from a specific host on the - Internet, another.source.of.spam. The next - entry accepts mail connections from a host Sendmail's + error handling routine. The message is sent to the remote + host when a mail matches the left side of the table. + The third entry rejects mail from a specific host on the + Internet, another.source.of.spam. The fourth + entry accepts mail connections from okay.cyberspammer.com, which is - more exact than the cyberspammer.com line above. More specific matches override less exact matches. The last - entry allows relaying of electronic mail from hosts with an + entry allows relaying of email from hosts with an IP address that begins with 128.32. These - hosts would be able to send mail through this mail server - that are destined for other mail servers. + hosts can send mail through this mail server + that is destined for other mail servers. - When this file is updated, you need to run - make in /etc/mail/ + Whenever this file is updated, run + make in /etc/mail/ to update the database. <filename>/etc/mail/aliases</filename> - The aliases database contains a list of virtual mailboxes - that are expanded to other user(s), files, programs or other - aliases. Here are a few examples that can be used in - /etc/mail/aliases: + This database contains a list of virtual mailboxes + that are expanded to other user(s), files, programs, or other + aliases. Here are a few examples to illustrate the +file format: Mail Aliases @@ -566,28 +582,29 @@ bit.bucket: /dev/null procmail: "|/usr/local/bin/procmail" - The file format is simple; the mailbox name on the left + The mailbox name on the left side of the colon is expanded to the target(s) on the right. - The first example expands the mailbox + The first entry expands the mailbox root to the mailbox localuser, which is then looked up again - in the aliases database. If no match is found, then the - message is delivered to the local user - localuser. The next example shows a + in the aliases database. If no match is +found, the + message is delivered to + localuser. The second entry shows a mail list. Mail to the mailbox ftp-bugs is expanded to the three local mailboxes joe, eric, and - paul. Note that a remote mailbox could - be specified as user@example.com. The next - example shows writing mail to a file, in this case - /dev/null. The last example shows - sending mail to a program, in this case the mail message is - written to the standard input of - /usr/local/bin/procmail through a &unix; + paul. A remote mailbox could + be specified as user@example.com. The third + entry shows how to write mail to a file, in this case + /dev/null. The last entry demonstrates + how to send mail to a program, + /usr/local/bin/procmail, through a &unix; pipe. - When this file is updated, you need to run - make in /etc/mail/ + Whenever this file is updated, run + make in /etc/mail/ to update the database. @@ -595,43 +612,44 @@ procmail: "|/usr/local/bin/procmail"This is a list of hostnames &man.sendmail.8; is to accept as the local host name. Place any domains or hosts that - sendmail is to be receiving mail - for. For example, if this mail server was to accept mail for + Sendmail will receive mail + for. For example, to configure a mail server to accept +mail for the domain example.com and - the host mail.example.com, its - local-host-names might look something - like this: + the host mail.example.com, add +these entries to + local-host-names: example.com mail.example.com - When this file is updated, &man.sendmail.8; needs to be - restarted to read the changes. + Whenever this file is updated, &man.sendmail.8; needs to be + restarted so that it will read the changes. <filename>/etc/mail/sendmail.cf</filename> - sendmail's master configuration - file, sendmail.cf controls the overall - behavior of sendmail, including - everything from rewriting e-mail addresses to printing rejection - messages to remote mail servers. Naturally, with such a diverse - role, this configuration file is quite complex and its details - are a bit out of the scope of this section. Fortunately, this + This is the master +configuration file for Sendmail. It +controls the overall + behavior of Sendmail, including + everything from rewriting email addresses to printing rejection + messages to remote mail servers. Accordingly, this +configuration file is quite complex. Fortunately, this file rarely needs to be changed for standard mail servers. - The master sendmail configuration + The master Sendmail configuration file can be built from &man.m4.1; macros that define the - features and behavior of sendmail. - Please see + features and behavior of Sendmail. + Refer to /usr/src/contrib/sendmail/cf/README for some of the details. - When changes to this file are made, - sendmail needs to be restarted for + Whenever changes to this file are made, + Sendmail needs to be restarted for the changes to take effect. @@ -641,7 +659,7 @@ mail.example.com The virtusertable maps mail addresses for virtual domains and mailboxes to real mailboxes. These mailboxes can be local, remote, aliases defined in - /etc/mail/aliases or files. + /etc/mail/aliases, or files. Example Virtual Domain Mail Map @@ -651,19 +669,19 @@ postmaster@example.com postmast @example.com joe - In the above example, we have a mapping for a domain + The above example contains a mapping for the domain example.com. This file - is processed in a first match order down the file. The first + is processed in a first match order. The first item maps root@example.com to the local mailbox - root. The next entry maps + root. The second entry maps postmaster@example.com to the mailbox postmaster on the host noc.example.net. Finally, if nothing from example.com has matched so far, it will match the last mapping, which matches every other mail message addressed to someone at - example.com. This will - be mapped to the local mailbox + example.com to the local +mailbox joe. @@ -682,137 +700,134 @@ postmaster@example.com postmast Gregory Neil Shapiro - Information taken from e-mails written + Information taken from emails written by - Changing Your Mail Transfer Agent + Changing the Mail Transfer Agent email change mta - As already mentioned, FreeBSD comes with - sendmail already installed as your - MTA (Mail Transfer Agent). Therefore by default it is - in charge of your outgoing and incoming mail. - - However, for a variety of reasons, some system - administrators want to change their system's MTA. These - reasons range from merely wanting to try out another MTA to + &os; comes with + Sendmail already installed as the + MTA which is + in charge of outgoing and incoming mail. + + However, the system + administrator can change the system's MTA. +The + reasons for doing so range from wanting to try out +another MTA to needing a specific feature or package which relies on another - mailer. Fortunately, whatever the reason, FreeBSD makes it + MTA. Whatever the reason, +&os; makes it easy to make the change. - Install a New MTA + Install a New <acronym>MTA</acronym> - You have a wide choice of MTAs available. A good - starting point is the - FreeBSD Ports Collection where - you will be able to find many. Of course you are free to use - any MTA you want from any location, as long as you can make - it run under FreeBSD. - - Start by installing your new MTA. Once it is installed - it gives you a chance to decide if it really fulfills your - needs, and also gives you the opportunity to configure your - new software before getting it to take over from - sendmail. When doing this, you - should be sure that installing the new software will not - attempt to overwrite system binaries such as - /usr/bin/sendmail. Otherwise, your new - mail software has essentially been put into service before - you have configured it. - - Please refer to your chosen MTA's documentation for - information on how to configure the software you have - chosen. + A wide choice of MTAs is available +from the mail category of the + &os; Ports Collection. + + Once a new MTA is installed, +configure the + new software and decide if it really fulfills your needs + before replacing Sendmail. + + Refer to the new chosen MTA's +documentation for + information on how to configure the software. - Disable <application>sendmail</application> + Disable <application>Sendmail</application> - If you disable sendmail's - outgoing mail service, it is important that you replace it - with an alternative mail delivery system. If - you choose not to, system functions such as + If Sendmail's + outgoing mail service is disabled, it is important that it +is replaced + with an alternative mail delivery system. Otherwise, system +functions such as &man.periodic.8; will be unable to deliver their results - by e-mail as they would normally expect to. Many parts of - your system may expect to have a functional - sendmail-compatible system. If + by email. Many parts of + the system expect a functional + MTA. If applications continue to use - sendmail's binaries to try to - send e-mail after you have disabled them, mail could go - into an inactive sendmail queue, + Sendmail's binaries to try to + send email they are disabled, mail could go + into an inactive Sendmail queue, and never be delivered. In order to completely disable - sendmail, including the outgoing - mail service, you must use + Sendmail, including the outgoing + mail service, add or edit the following lines in + /etc/rc.conf: sendmail_enable="NO" sendmail_submit_enable="NO" sendmail_outbound_enable="NO" sendmail_msp_queue_enable="NO" - in /etc/rc.conf. - - If you only want to disable - sendmail's incoming mail service, - you should set + To only disable + Sendmail's incoming mail service, + set sendmail_enable="NO" in /etc/rc.conf. More information - on sendmail's startup options - is available from the &man.rc.sendmail.8; manual - page. + on Sendmail's startup options + is available in &man.rc.sendmail.8;. - Running Your New MTA on Boot + Running the New <acronym>MTA</acronym> on Boot - The new MTA can be started during boot by adding a - configuration line to /etc/rc.conf - like the following example for postfix: + The new MTA can be started during +boot by adding a + configuration line to /etc/rc.conf. + This example enables the + Postfix MTA: &prompt.root; echo 'postfix_enable=YES' >> /etc/rc.conf - The MTA will now be automatically started during + The specified MTA will now be +automatically started during boot. - Replacing <application>sendmail</application> as + <title>Replacing <application>Sendmail</application> as the System's Default Mailer - The program sendmail is so + Sendmail is so ubiquitous as standard software on &unix; systems that some - software just assumes it is already installed and configured. - For this reason, many alternative MTA's provide their own + software assumes it is already installed and configured. + For this reason, many alternative MTAs +provide their own compatible implementations of the - sendmail command-line interface; - this facilitates using them as drop-in - replacements for sendmail. - - Therefore, if you are using an alternative mailer, - you will need to make sure that software trying to execute - standard sendmail binaries such as - /usr/bin/sendmail actually executes - your chosen mailer instead. Fortunately, FreeBSD provides - a system called &man.mailwrapper.8; that does this job for - you. - - When sendmail is operating - as installed, you will find something like the following - in /etc/mail/mailer.conf: + Sendmail command-line interface in +order to + facilitate using them as drop-in + replacements for Sendmail. + + When using an alternative MTA, + make sure that software trying to execute + standard Sendmail binaries, such as + /usr/bin/sendmail, actually execute + the chosen mailer instead. Fortunately, &os; provides + a system called &man.mailwrapper.8; for this purpose. + + When Sendmail is operating + as installed, +/etc/mail/mailer.conf will look like this: sendmail /usr/libexec/sendmail/sendmail send-mail /usr/libexec/sendmail/sendmail @@ -821,21 +836,19 @@ newaliases /usr/libexec/sendmail/sendmai hoststat /usr/libexec/sendmail/sendmail purgestat /usr/libexec/sendmail/sendmail *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***