|
Lines 49-55
Link Here
|
| 49 |
|
49 |
|
| 50 |
<listitem> |
50 |
<listitem> |
| 51 |
<para>Where basic <application>sendmail</application> configuration |
51 |
<para>Where basic <application>sendmail</application> configuration |
| 52 |
files are located in FreeBSD.</para> |
52 |
files are located in &os;.</para> |
| 53 |
</listitem> |
53 |
</listitem> |
| 54 |
|
54 |
|
| 55 |
<listitem> |
55 |
<listitem> |
|
Lines 113-120
Link Here
|
| 113 |
</listitem> |
113 |
</listitem> |
| 114 |
|
114 |
|
| 115 |
<listitem> |
115 |
<listitem> |
| 116 |
<para>Properly set up the DNS information for your mail host |
116 |
<para>Properly set up the <acronym>DNS</acronym> information |
| 117 |
(<xref linkend="advanced-networking">).</para> |
117 |
for your mail host (<xref linkend="advanced-networking">).</para> |
| 118 |
</listitem> |
118 |
</listitem> |
| 119 |
|
119 |
|
| 120 |
<listitem> |
120 |
<listitem> |
|
Lines 133-140
Link Here
|
| 133 |
are: <link linkend="mail-mua">the user program</link>, <link |
133 |
are: <link linkend="mail-mua">the user program</link>, <link |
| 134 |
linkend="mail-mta">the server daemon</link>, <link |
134 |
linkend="mail-mta">the server daemon</link>, <link |
| 135 |
linkend="mail-dns">DNS</link>, <link linkend="mail-receive">a |
135 |
linkend="mail-dns">DNS</link>, <link linkend="mail-receive">a |
| 136 |
remote or local mailbox</link>, and of course, <link linkend="mail-host">the |
136 |
remote or local mailbox</link>, and of course, <link |
| 137 |
mailhost itself</link>.</para> |
137 |
linkend="mail-host">the mailhost itself</link>.</para> |
| 138 |
|
138 |
|
| 139 |
<sect2 id="mail-mua"> |
139 |
<sect2 id="mail-mua"> |
| 140 |
<title>The User Program</title> |
140 |
<title>The User Program</title> |
|
Lines 142-156
Link Here
|
| 142 |
<para>This includes command line programs such as |
142 |
<para>This includes command line programs such as |
| 143 |
<application>mutt</application>, |
143 |
<application>mutt</application>, |
| 144 |
<application>pine</application>, <application>elm</application>, |
144 |
<application>pine</application>, <application>elm</application>, |
| 145 |
and <command>mail</command>, and <acronym>GUI</acronym> programs such as |
145 |
and <command>mail</command>, and <acronym>GUI</acronym> programs |
| 146 |
<application>balsa</application>, |
146 |
such as <application>balsa</application>, |
| 147 |
<application>xfmail</application> to name a few, and something |
147 |
<application>xfmail</application> to name a few, and something |
| 148 |
more <quote>sophisticated</quote> like a WWW browser. These |
148 |
more <quote>sophisticated</quote> like a WWW browser. These |
| 149 |
programs simply pass off the email transactions to the local |
149 |
programs simply pass off the email transactions to the local |
| 150 |
<link linkend="mail-host"><quote>mailhost</quote></link>, either |
150 |
<link linkend="mail-host"><quote>mailhost</quote></link>, either |
| 151 |
by calling one of the <link linkend="mail-mta">server |
151 |
by calling one of the <link linkend="mail-mta">server |
| 152 |
daemons</link> available, or delivering it over <acronym>TCP</acronym>.</para> |
152 |
daemons</link> available, or delivering it over |
| 153 |
</sect2> |
153 |
<acronym>TCP</acronym>.</para> |
|
|
154 |
</sect2> |
| 154 |
|
155 |
|
| 155 |
<sect2 id="mail-mta"> |
156 |
<sect2 id="mail-mta"> |
| 156 |
<title>Mailhost Server Daemon</title> |
157 |
<title>Mailhost Server Daemon</title> |
|
Lines 171-214
Link Here
|
| 171 |
<secondary><application>exim</application></secondary> |
172 |
<secondary><application>exim</application></secondary> |
| 172 |
</indexterm> |
173 |
</indexterm> |
| 173 |
|
174 |
|
| 174 |
<para>This is usually <application>sendmail</application> (by |
175 |
<para>&os; ships with <application>sendmail</application> by |
| 175 |
default with FreeBSD) or one of the other mail server daemons such |
176 |
default, but also support numerous other mail server daemons, |
| 176 |
as <application>qmail</application>, |
177 |
just some of which include:</para> |
| 177 |
<application>postfix</application>, or |
178 |
|
| 178 |
<application>exim</application>. There are others, but those are |
179 |
<itemizedlist> |
| 179 |
the most widely used.</para> |
180 |
<listitem> |
| 180 |
|
181 |
<para><application>postfix</application>;</para> |
| 181 |
<para>The server daemon usually has two functions—it looks |
182 |
</listitem> |
| 182 |
after receiving incoming mail and delivers outgoing mail. It is |
183 |
|
| 183 |
not responsible for allowing you to collect mail using protocols |
184 |
<listitem> |
| 184 |
such as <acronym>POP</acronym> or <acronym>IMAP</acronym> to |
185 |
<para><application>exim</application>;</para> |
| 185 |
read your email, nor does it allow connecting to local |
186 |
</listitem> |
| 186 |
<filename>mbox</filename> or Maildir mailboxes. You may require |
187 |
|
| 187 |
an additional <link linkend="mail-receive">daemon</link> for |
188 |
<listitem> |
| 188 |
that.</para> |
189 |
<para><application>qmail</application>;</para> |
| 189 |
|
190 |
</listitem> |
| 190 |
<para>Be aware that some older versions of |
191 |
</itemizedlist> |
| 191 |
<application>sendmail</application> have some serious security |
192 |
|
| 192 |
problems, however as long as you run a current version of it you |
193 |
<para>The server daemon usually has two functions—it is |
| 193 |
should not have any problems. As always, it is a good idea to |
194 |
responsible for receiving incoming mail as well as delivering |
| 194 |
stay up-to-date with any software you run.</para> |
195 |
outgoing mail. It is <emphasis>not</emphasis> responsible for |
|
|
196 |
the collection of mail using protocols such as |
| 197 |
<acronym>POP</acronym> or <acronym>IMAP</acronym> to read email, |
| 198 |
nor does it allow connecting to local <filename>mbox</filename> |
| 199 |
or Maildir mailboxes. You may require an additional <link |
| 200 |
linkend="mail-receive">daemon</link> for that.</para> |
| 201 |
|
| 202 |
<warning> |
| 203 |
<para>Older versions of <application>sendmail</application> have |
| 204 |
some serious security issues which may result in an attacker |
| 205 |
gaining local and/or remote access to your machine. Make sure |
| 206 |
that you are running a current version to avoid these |
| 207 |
problems. Optionally, install an alternative |
| 208 |
<acronym>MTA</acronym> from the <link linkend="ports">&os; |
| 209 |
Ports Collection</link>.</para> |
| 210 |
</warning> |
| 195 |
</sect2> |
211 |
</sect2> |
| 196 |
|
212 |
|
| 197 |
<sect2 id="mail-dns"> |
213 |
<sect2 id="mail-dns"> |
| 198 |
<title>Email and DNS</title> |
214 |
<title>Email and DNS</title> |
| 199 |
|
215 |
|
| 200 |
<para>The Domain Name System (DNS) and its daemon |
216 |
<para>The Domain Name System (<acronym>DNS</acronym>) and its daemon |
| 201 |
<command>named</command> play a large role in the delivery of |
217 |
<command>named</command> play a large role in the delivery of |
| 202 |
email. In order to deliver mail from your site to another, the |
218 |
email. In order to deliver mail from one site to another, the |
| 203 |
server daemon will look up the site in the DNS to determine the |
219 |
server daemon looks up the remote site in <acronym>DNS</acronym> |
| 204 |
host that will receive mail for the destination.</para> |
220 |
to determine the host that will receive mail for the |
| 205 |
|
221 |
destination. This process also occurs when mail is sent from a |
| 206 |
<para>It works the same way when you have mail sent to you. The DNS |
222 |
remote host to your mail server.</para> |
| 207 |
contains the database mapping hostname to an IP address, and a |
223 |
|
| 208 |
hostname to mailhost. The IP address is specified in an A record. |
224 |
<para><acronym>DNS</acronym> is responsible for mapping hostnames |
| 209 |
The MX (Mail eXchanger) record specifies the mailhost that will |
225 |
to IP addresses, as well as for storing information specific to |
| 210 |
receive mail for you. If you do not have an MX record for your |
226 |
mail delivery, known as MX records. The MX (Mail eXchanger) |
| 211 |
hostname, the mail will be delivered directly to your host.</para> |
227 |
record specifies which host, or hosts, will recieve mail for a |
|
|
228 |
particular domain. If you do not have an MX record for your |
| 229 |
hostname or domain, the mail will be delivered directly to your |
| 230 |
host provided you have an A record pointing your hostname to |
| 231 |
your IP address.</para> |
| 232 |
|
| 233 |
<para>You may view the MX records for any domain by using the |
| 234 |
&man.host.1; command, as seen in the example below:</para> |
| 235 |
|
| 236 |
<screen>&prompt.user; <userinput>host -t mx &os;.org</userinput> |
| 237 |
&os;.org mail is handled (pri=10) by mx1.&os;.org</screen> |
| 212 |
</sect2> |
238 |
</sect2> |
| 213 |
|
239 |
|
| 214 |
<sect2 id="mail-receive"> |
240 |
<sect2 id="mail-receive"> |
|
Lines 219-232
Link Here
|
| 219 |
</indexterm> |
245 |
</indexterm> |
| 220 |
|
246 |
|
| 221 |
<para>Receiving mail for your domain is done by the mail host. It |
247 |
<para>Receiving mail for your domain is done by the mail host. It |
| 222 |
will collect mail sent to you and store it for reading or pickup |
248 |
collects all mail sent to your domain and stores it either in |
| 223 |
in either <filename>mbox</filename> or Maildir format, depending |
249 |
<filename>mbox</filename> (the default method for storing mail) |
| 224 |
on your configuration. Mail can then be remotely accessed using |
250 |
or Maildir format, depending on your configuration. Once mail |
| 225 |
either <acronym>POP</acronym> or <acronym>IMAP</acronym>, or |
251 |
has been stored, it may either be read locally using |
| 226 |
alternatively by using a mail user agent that is locally |
252 |
applications such as &man.mail.1; or |
| 227 |
installed on the mail host itself which will directly |
253 |
<application>mutt</application>, or remotely accessed and |
| 228 |
communicate with the mailbox. This means that should you only |
254 |
collected using protocols such as <acronym>POP</acronym> or |
| 229 |
wish to read mail locally, you are not required to install a |
255 |
<acronym>IMAP</acronym>. This means that should you only wish |
|
|
256 |
to read mail locally, you are not required to install a |
| 230 |
<acronym>POP</acronym> or <acronym>IMAP</acronym> server.</para> |
257 |
<acronym>POP</acronym> or <acronym>IMAP</acronym> server.</para> |
| 231 |
|
258 |
|
| 232 |
<sect3 id="pop-and-imap"> |
259 |
<sect3 id="pop-and-imap"> |
|
Lines 327-333
Link Here
|
| 327 |
<para>Mailboxes may be accessed locally by directly utilizing |
354 |
<para>Mailboxes may be accessed locally by directly utilizing |
| 328 |
<acronym>MUA</acronym>'s on the server on which the mailbox |
355 |
<acronym>MUA</acronym>'s on the server on which the mailbox |
| 329 |
resides. This can be done using applications such as |
356 |
resides. This can be done using applications such as |
| 330 |
<application>mutt</application> or <command>mail</command>. |
357 |
<application>mutt</application> or &man.mail.1;. |
| 331 |
</para> |
358 |
</para> |
| 332 |
</sect3> |
359 |
</sect3> |
| 333 |
</sect2> |
360 |
</sect2> |
|
Lines 359-367
Link Here
|
| 359 |
</indexterm> |
386 |
</indexterm> |
| 360 |
|
387 |
|
| 361 |
<para>&man.sendmail.8; is the default Mail Transfer Agent (MTA) in |
388 |
<para>&man.sendmail.8; is the default Mail Transfer Agent (MTA) in |
| 362 |
FreeBSD. <application>sendmail</application>'s job is to accept |
389 |
&os;. <application>sendmail</application>'s job is to accept mail |
| 363 |
mail from Mail User Agents (<acronym>MUA</acronym>) and deliver it |
390 |
from Mail User Agents (<acronym>MUA</acronym>) and deliver it to |
| 364 |
to the appropriate mailer as defined by its configuration file. |
391 |
the appropriate mailer as defined by its configuration file. |
| 365 |
<application>sendmail</application> can also accept network |
392 |
<application>sendmail</application> can also accept network |
| 366 |
connections and deliver mail to local mailboxes or deliver it to |
393 |
connections and deliver mail to local mailboxes or deliver it to |
| 367 |
another program.</para> |
394 |
another program.</para> |
|
Lines 493-499
Link Here
|
| 493 |
mail servers.</para> |
520 |
mail servers.</para> |
| 494 |
|
521 |
|
| 495 |
<para>When this file is updated, you need to run |
522 |
<para>When this file is updated, you need to run |
| 496 |
<command>make</command> in <filename>/etc/mail/</filename> to |
523 |
&man.make.1; in <filename>/etc/mail/</filename> to |
| 497 |
update the database.</para> |
524 |
update the database.</para> |
| 498 |
|
525 |
|
| 499 |
</sect2> |
526 |
</sect2> |
|
Lines 532-538
Link Here
|
| 532 |
through a &unix; pipe.</para> |
559 |
through a &unix; pipe.</para> |
| 533 |
|
560 |
|
| 534 |
<para>When this file is updated, you need to run |
561 |
<para>When this file is updated, you need to run |
| 535 |
<command>make</command> in <filename>/etc/mail/</filename> to |
562 |
&man.make.1; in <filename>/etc/mail/</filename> to |
| 536 |
update the database.</para> |
563 |
update the database.</para> |
| 537 |
</sect2> |
564 |
</sect2> |
| 538 |
<sect2> |
565 |
<sect2> |
|
Lines 632-658
Link Here
|
| 632 |
<secondary>change mta</secondary> |
659 |
<secondary>change mta</secondary> |
| 633 |
</indexterm> |
660 |
</indexterm> |
| 634 |
|
661 |
|
| 635 |
<para>As already mentioned, FreeBSD comes with |
662 |
<para>As already mentioned, &os; comes with |
| 636 |
<application>sendmail</application> already installed as your |
663 |
<application>sendmail</application> already installed as your MTA |
| 637 |
MTA (Mail Transfer Agent). Therefore by default it is |
664 |
(Mail Transfer Agent). Therefore by default it is in charge of |
| 638 |
in charge of your outgoing and incoming mail.</para> |
665 |
your outgoing and incoming mail.</para> |
| 639 |
|
666 |
|
| 640 |
<para>However, for a variety of reasons, some system |
667 |
<para>However, for a variety of reasons, some system administrators |
| 641 |
administrators want to change their system's MTA. These |
668 |
want to change their system's MTA. These reasons range from |
| 642 |
reasons range from simply wanting to try out another MTA to |
669 |
simply wanting to try out another MTA to needing a specific |
| 643 |
needing a specific feature or package which relies on another |
670 |
feature or package which relies on another mailer. Fortunately, |
| 644 |
mailer. Fortunately, whatever the reason, FreeBSD makes it |
671 |
whatever the reason, &os; makes it easy to make the change.</para> |
| 645 |
easy to make the change.</para> |
|
|
| 646 |
|
672 |
|
| 647 |
<sect2> |
673 |
<sect2> |
| 648 |
<title>Install a New MTA</title> |
674 |
<title>Install a New MTA</title> |
| 649 |
|
675 |
|
| 650 |
<para>You have a wide choice of MTAs available. A good |
676 |
<para>You have a wide choice of MTAs available. A good |
| 651 |
starting point is the |
677 |
starting point is the |
| 652 |
<link linkend="ports">FreeBSD Ports Collection</link> where |
678 |
<link linkend="ports">&os; Ports Collection</link> where |
| 653 |
you will be able to find many. Of course you are free to use |
679 |
you will be able to find many. Of course you are free to use |
| 654 |
any MTA you want from any location, as long as you can make |
680 |
any MTA you want from any location, as long as you can make |
| 655 |
it run under FreeBSD.</para> |
681 |
it run under &os;.</para> |
| 656 |
|
682 |
|
| 657 |
<para>Start by installing your new MTA. Once it is installed |
683 |
<para>Start by installing your new MTA. Once it is installed |
| 658 |
it gives you a chance to decide if it really fulfills your |
684 |
it gives you a chance to decide if it really fulfills your |
|
Lines 679-685
Link Here
|
| 679 |
used to disable it is subtly different.</para> |
705 |
used to disable it is subtly different.</para> |
| 680 |
|
706 |
|
| 681 |
<sect3> |
707 |
<sect3> |
| 682 |
<title>FreeBSD 4.5-STABLE before 2002/4/4 and Earlier |
708 |
<title>&os; 4.5-STABLE before 2002/4/4 and Earlier |
| 683 |
(Including 4.5-RELEASE and Earlier)</title> |
709 |
(Including 4.5-RELEASE and Earlier)</title> |
| 684 |
|
710 |
|
| 685 |
<para>Enter:</para> |
711 |
<para>Enter:</para> |
|
Lines 694-700
Link Here
|
| 694 |
</sect3> |
720 |
</sect3> |
| 695 |
|
721 |
|
| 696 |
<sect3> |
722 |
<sect3> |
| 697 |
<title>FreeBSD 4.5-STABLE after 2002/4/4 |
723 |
<title>&os; 4.5-STABLE after 2002/4/4 |
| 698 |
(Including 4.6-RELEASE and Later)</title> |
724 |
(Including 4.6-RELEASE and Later)</title> |
| 699 |
|
725 |
|
| 700 |
<para>In order to completely disable |
726 |
<para>In order to completely disable |
|
Lines 735-745
Link Here
|
| 735 |
<title>Running Your New MTA on Boot</title> |
761 |
<title>Running Your New MTA on Boot</title> |
| 736 |
|
762 |
|
| 737 |
<para>You may have a choice of two methods for running your |
763 |
<para>You may have a choice of two methods for running your |
| 738 |
new MTA on boot, again depending on what version of FreeBSD |
764 |
new MTA on boot, again depending on what version of &os; |
| 739 |
you are running.</para> |
765 |
you are running.</para> |
| 740 |
|
766 |
|
| 741 |
<sect3> |
767 |
<sect3> |
| 742 |
<title>FreeBSD 4.5-STABLE before 2002/4/11 |
768 |
<title>&os; 4.5-STABLE before 2002/4/11 |
| 743 |
(Including 4.5-RELEASE and Earlier)</title> |
769 |
(Including 4.5-RELEASE and Earlier)</title> |
| 744 |
|
770 |
|
| 745 |
<para>Add a script to |
771 |
<para>Add a script to |
|
Lines 763-772
Link Here
|
| 763 |
</sect3> |
789 |
</sect3> |
| 764 |
|
790 |
|
| 765 |
<sect3> |
791 |
<sect3> |
| 766 |
<title>FreeBSD 4.5-STABLE after 2002/4/11 |
792 |
<title>&os; 4.5-STABLE after 2002/4/11 |
| 767 |
(Including 4.6-RELEASE and Later)</title> |
793 |
(Including 4.6-RELEASE and Later)</title> |
| 768 |
|
794 |
|
| 769 |
<para>With later versions of FreeBSD, you can use the |
795 |
<para>With later versions of &os;, you can use the |
| 770 |
above method or you can set</para> |
796 |
above method or you can set</para> |
| 771 |
|
797 |
|
| 772 |
<programlisting>mta_start_script="filename"</programlisting> |
798 |
<programlisting>mta_start_script="filename"</programlisting> |
|
Lines 795-801
Link Here
|
| 795 |
you will need to make sure that software trying to execute |
821 |
you will need to make sure that software trying to execute |
| 796 |
standard <application>sendmail</application> binaries such as |
822 |
standard <application>sendmail</application> binaries such as |
| 797 |
<filename>/usr/bin/sendmail</filename> actually executes |
823 |
<filename>/usr/bin/sendmail</filename> actually executes |
| 798 |
your chosen mailer instead. Fortunately, FreeBSD provides |
824 |
your chosen mailer instead. Fortunately, &os; provides |
| 799 |
a system called &man.mailwrapper.8; that does this job for |
825 |
a system called &man.mailwrapper.8; that does this job for |
| 800 |
you.</para> |
826 |
you.</para> |
| 801 |
|
827 |
|
|
Lines 872-883
Link Here
|
| 872 |
<indexterm><primary>BIND</primary></indexterm> |
898 |
<indexterm><primary>BIND</primary></indexterm> |
| 873 |
<para>Traditionally, this was allowed by BSD BIND resolvers. |
899 |
<para>Traditionally, this was allowed by BSD BIND resolvers. |
| 874 |
However the current version of <application>BIND</application> |
900 |
However the current version of <application>BIND</application> |
| 875 |
that ships with FreeBSD no longer provides default abbreviations |
901 |
that ships with &os; no longer provides default abbreviations |
| 876 |
for non-fully qualified domain names other than the domain you |
902 |
for non-fully qualified domain names other than the domain you |
| 877 |
are in. So an unqualified host <hostid>mumble</hostid> must |
903 |
are in. So an unqualified host <hostid>mumble</hostid> must |
| 878 |
either be found as <hostid |
904 |
either be found as <hostid |
| 879 |
role="fqdn">mumble.foo.bar.edu</hostid>, or it will be searched |
905 |
role="fqdn">mumble.foo.bar.edu</hostid>, or it will be |
| 880 |
for in the root domain.</para> |
906 |
searched for in the root domain.</para> |
| 881 |
|
907 |
|
| 882 |
<para>This is different from the previous behavior, where the |
908 |
<para>This is different from the previous behavior, where the |
| 883 |
search continued across <hostid |
909 |
search continued across <hostid |
|
Lines 911-929
Link Here
|
| 911 |
<para>This is answered in the |
937 |
<para>This is answered in the |
| 912 |
<application>sendmail</application> FAQ as follows:</para> |
938 |
<application>sendmail</application> FAQ as follows:</para> |
| 913 |
|
939 |
|
| 914 |
<programlisting>I am getting <quote>Local configuration error</quote> messages, such as: |
940 |
<programlisting>I'm getting these error messages: |
| 915 |
|
941 |
|
| 916 |
553 relay.domain.net config error: mail loops back to myself |
942 |
553 MX list for domain.net points back to relay.domain.net |
| 917 |
554 <user@domain.net>... Local configuration error |
943 |
554 <user@domain.net>... Local configuration error |
| 918 |
|
944 |
|
| 919 |
How can I solve this problem? |
945 |
How can I solve this problem? |
| 920 |
|
946 |
|
| 921 |
You have asked mail to the domain (e.g., domain.net) to be |
947 |
You have asked mail to a domain (e.g., domain.net) to be forwarded to a |
| 922 |
forwarded to a specific host (in this case, relay.domain.net) |
948 |
specific host (in this case, relay.domain.net) by using an MX record, |
| 923 |
by using an MX record, but the relay machine does not recognize |
949 |
but the relay machine doesn't recognize itself as domain.net. Add |
| 924 |
itself as domain.net. Add domain.net to /etc/mail/local-host-names |
950 |
domain.net to /etc/mail/local-host-names [known as /etc/sendmail.cw |
| 925 |
(if you are using FEATURE(use_cw_file)) or add <quote>Cw domain.net</quote> |
951 |
prior to version 8.10] (if you are using FEATURE(`use_cw_file')) or add |
| 926 |
to /etc/mail/sendmail.cf.</programlisting> |
952 |
"Cw domain.net" to your configuration file. |
|
|
953 |
|
| 954 |
There are a couple of additional cases where you don't actually want |
| 955 |
local delivery, and thus adding domain.net to class w is not the right |
| 956 |
fix: |
| 957 |
|
| 958 |
When relay.domain.net should just be acting as a forwarder, e.g. |
| 959 |
a firewall/gateway box. The proper fix could be to set up a |
| 960 |
mailertable entry for domain.net. |
| 961 |
|
| 962 |
When relay.domain.net is a secondary (etc.) MX, and the MX |
| 963 |
mistakenly points to a CNAME or other "non-canonical" name [this |
| 964 |
gives "config error: mail loops back to me (MX problem?)"]. The |
| 965 |
proper fix is to point the MX at the actual name, a |
| 966 |
"work-around" to add the MX target to class w. |
| 967 |
|
| 968 |
IMPORTANT: When making changes to your configuration file, be sure you |
| 969 |
kill and restart the sendmail daemon (for any change in the |
| 970 |
configuration, not just this one): |
| 971 |
|
| 972 |
kill -HUP `head -1 /var/run/sendmail.pid` |
| 973 |
Note: You can also get this error message (MX loops ...) when two |
| 974 |
sendmail systems talk to each other, and both have the same value of $j. |
| 975 |
The best solution is "don't do that."</programlisting> |
| 927 |
|
976 |
|
| 928 |
<para>The <application>sendmail</application> FAQ can be found at |
977 |
<para>The <application>sendmail</application> FAQ can be found at |
| 929 |
<ulink URL="http://www.sendmail.org/faq/"></ulink> and is |
978 |
<ulink URL="http://www.sendmail.org/faq/"></ulink> and is |
|
Lines 939-946
Link Here
|
| 939 |
</question> |
988 |
</question> |
| 940 |
|
989 |
|
| 941 |
<answer> |
990 |
<answer> |
| 942 |
<para>You want to connect a FreeBSD box on a LAN to the |
991 |
<para>You want to connect a &os; box on a LAN to the |
| 943 |
Internet. The FreeBSD box will be a mail gateway for the LAN. |
992 |
Internet. The &os; box will be a mail gateway for the LAN. |
| 944 |
The PPP connection is non-dedicated.</para> |
993 |
The PPP connection is non-dedicated.</para> |
| 945 |
|
994 |
|
| 946 |
<indexterm><primary>UUCP</primary></indexterm> |
995 |
<indexterm><primary>UUCP</primary></indexterm> |
|
Lines 1007-1018
Link Here
|
| 1007 |
# local config error. |
1056 |
# local config error. |
| 1008 |
OwTrue |
1057 |
OwTrue |
| 1009 |
|
1058 |
|
| 1010 |
That way a remote site will deliver straight to you, without trying |
1059 |
That way a remote site will deliver straight to you, without trying the |
| 1011 |
the customer connection. You then send to your customer. Only works for |
1060 |
customer connection. You then send to your customer. Only works for |
| 1012 |
<quote>hosts</quote>, so you need to get your customer to name their mail |
1061 |
<quote>hosts</quote>, so you need to get your customer to name their |
| 1013 |
machine <quote>customer.com</quote> as well as |
1062 |
mail machine <quote>customer.com</quote> as well as |
| 1014 |
<quote>hostname.customer.com</quote> in the DNS. Just put an A record in |
1063 |
<quote>hostname.customer.com</quote> in the <acronym>DNS</acronym>. |
| 1015 |
the DNS for <quote>customer.com</quote>.</programlisting> |
1064 |
Just put an A record in the <acronym>DNS</acronym> for |
|
|
1065 |
<quote>customer.com</quote>.</programlisting> |
| 1016 |
</answer> |
1066 |
</answer> |
| 1017 |
</qandaentry> |
1067 |
</qandaentry> |
| 1018 |
|
1068 |
|
|
Lines 1024-1030
Link Here
|
| 1024 |
</question> |
1074 |
</question> |
| 1025 |
|
1075 |
|
| 1026 |
<answer> |
1076 |
<answer> |
| 1027 |
<para>In default FreeBSD installations, |
1077 |
<para>In default &os; installations, |
| 1028 |
<application>sendmail</application> is configured to only |
1078 |
<application>sendmail</application> is configured to only |
| 1029 |
send mail from the host it is running on. For example, if |
1079 |
send mail from the host it is running on. For example, if |
| 1030 |
a <acronym>POP</acronym> server is available, then users |
1080 |
a <acronym>POP</acronym> server is available, then users |
|
Lines 1084-1106
Link Here
|
| 1084 |
</indexterm> |
1134 |
</indexterm> |
| 1085 |
|
1135 |
|
| 1086 |
<para>Out of the box, you should be able to send email to external |
1136 |
<para>Out of the box, you should be able to send email to external |
| 1087 |
hosts as long as you have set up |
1137 |
hosts as long as you have set up |
| 1088 |
<filename>/etc/resolv.conf</filename> or are running your own |
1138 |
<filename>/etc/resolv.conf</filename> or are running your own |
| 1089 |
name server. If you would like to have mail for your host |
1139 |
name server. If you would like to have mail for your host |
| 1090 |
delivered to the MTA (e.g., <application>sendmail</application>) on your own FreeBSD host, there are two methods:</para> |
1140 |
delivered to the MTA (e.g., <application>sendmail</application>) |
|
|
1141 |
on your own &os; host, there are two methods:</para> |
| 1091 |
|
1142 |
|
| 1092 |
<itemizedlist> |
1143 |
<itemizedlist> |
| 1093 |
<listitem> |
1144 |
<listitem> |
| 1094 |
<para>Run your own name server and have your own domain. For |
1145 |
<para>Run your own name server and have your own domain. For |
| 1095 |
example, <hostid |
1146 |
example, <hostid |
| 1096 |
role="domainname">FreeBSD.org</hostid></para> |
1147 |
role="domainname">&os;.org</hostid></para> |
| 1097 |
</listitem> |
1148 |
</listitem> |
| 1098 |
|
1149 |
|
| 1099 |
<listitem> |
1150 |
<listitem> |
| 1100 |
<para>Get mail delivered directly to your host. This is done by |
1151 |
<para>Get mail delivered directly to your host. This is done by |
| 1101 |
delivering mail directly to the current DNS name for your |
1152 |
delivering mail directly to the current |
| 1102 |
machine. For example, <hostid |
1153 |
<acronym>DNS</acronym> name for your machine. For example, |
| 1103 |
role="fqdn">example.FreeBSD.org</hostid>.</para> |
1154 |
<hostid role="fqdn">example.&os;.org</hostid>.</para> |
| 1104 |
</listitem> |
1155 |
</listitem> |
| 1105 |
</itemizedlist> |
1156 |
</itemizedlist> |
| 1106 |
|
1157 |
|
|
Lines 1115-1127
Link Here
|
| 1115 |
<itemizedlist> |
1166 |
<itemizedlist> |
| 1116 |
<indexterm><primary>MX record</primary></indexterm> |
1167 |
<indexterm><primary>MX record</primary></indexterm> |
| 1117 |
<listitem> |
1168 |
<listitem> |
| 1118 |
<para>Make sure that the (lowest-numbered) MX record in your DNS points to your |
1169 |
<para>Make sure that the (lowest-numbered) MX record in your |
| 1119 |
host's IP address.</para> |
1170 |
<acronym>DNS</acronym> points to your host's IP |
|
|
1171 |
address.</para> |
| 1120 |
</listitem> |
1172 |
</listitem> |
| 1121 |
|
1173 |
|
| 1122 |
<listitem> |
1174 |
<listitem> |
| 1123 |
<para>Make sure there is no MX entry in your DNS for your |
1175 |
<para>Make sure there is no MX entry in your |
| 1124 |
host.</para> |
1176 |
<acronym>DNS</acronym> for your host.</para> |
| 1125 |
</listitem> |
1177 |
</listitem> |
| 1126 |
</itemizedlist> |
1178 |
</itemizedlist> |
| 1127 |
|
1179 |
|
|
Lines 1131-1169
Link Here
|
| 1131 |
<para>Try this:</para> |
1183 |
<para>Try this:</para> |
| 1132 |
|
1184 |
|
| 1133 |
<screen>&prompt.root; <userinput>hostname</userinput> |
1185 |
<screen>&prompt.root; <userinput>hostname</userinput> |
| 1134 |
example.FreeBSD.org |
1186 |
example.&os;.org |
| 1135 |
&prompt.root; <userinput>host example.FreeBSD.org</userinput> |
1187 |
&prompt.root; <userinput>host example.&os;.org</userinput> |
| 1136 |
example.FreeBSD.org has address 204.216.27.XX</screen> |
1188 |
example.&os;.org has address 204.216.27.XX</screen> |
| 1137 |
|
1189 |
|
| 1138 |
<para>If that is what you see, mail directly to |
1190 |
<para>If that is what you see, mail directly to |
| 1139 |
<email>yourlogin@example.FreeBSD.org</email> should work without |
1191 |
<email>yourlogin@example.&os;.org</email> should work without |
| 1140 |
problems (assuming <application>sendmail</application> is |
1192 |
problems (assuming <application>sendmail</application> is |
| 1141 |
running correctly on <hostid role="fqdn">example.FreeBSD.org</hostid>).</para> |
1193 |
running correctly on <hostid role="fqdn">example.&os;.org</hostid>).</para> |
| 1142 |
|
1194 |
|
| 1143 |
<para>If instead you see something like this:</para> |
1195 |
<para>If instead you see something like this:</para> |
| 1144 |
|
1196 |
|
| 1145 |
<screen>&prompt.root; <userinput>host example.FreeBSD.org</userinput> |
1197 |
<screen>&prompt.root; <userinput>host example.&os;.org</userinput> |
| 1146 |
example.FreeBSD.org has address 204.216.27.XX |
1198 |
example.&os;.org has address 204.216.27.XX |
| 1147 |
example.FreeBSD.org mail is handled (pri=10) by hub.FreeBSD.org</screen> |
1199 |
example.&os;.org mail is handled (pri=10) by hub.&os;.org</screen> |
| 1148 |
|
1200 |
|
| 1149 |
<para>All mail sent to your host (<hostid |
1201 |
<para>All mail sent to your host (<hostid |
| 1150 |
role="fqdn">example.FreeBSD.org</hostid>) will end up being |
1202 |
role="fqdn">example.&os;.org</hostid>) will end up being |
| 1151 |
collected on <hostid>hub</hostid> under the same username instead |
1203 |
collected on <hostid>hub</hostid> under the same username instead |
| 1152 |
of being sent directly to your host.</para> |
1204 |
of being sent directly to your host.</para> |
| 1153 |
|
1205 |
|
| 1154 |
<para>The above information is handled by your DNS server. The DNS |
1206 |
<para>The above information is handled by your |
| 1155 |
record that carries mail routing information is the |
1207 |
<acronym>DNS</acronym> server. The <acronym>DNS</acronym> |
| 1156 |
<emphasis>M</emphasis>ail e<emphasis>X</emphasis>change entry. If |
1208 |
record that carries mail routing information is the |
| 1157 |
no MX record exists, mail will be delivered directly to the host by |
1209 |
<emphasis>M</emphasis>ail e<emphasis>X</emphasis>change entry. |
| 1158 |
way of its IP address.</para> |
1210 |
If no MX record exists, mail will be delivered directly to the |
|
|
1211 |
host by way of its IP address.</para> |
| 1159 |
|
1212 |
|
| 1160 |
<para>The MX entry for <hostid |
1213 |
<para>The MX entry for <hostid |
| 1161 |
role="fqdn">freefall.FreeBSD.org</hostid> at one time looked like |
1214 |
role="fqdn">freefall.&os;.org</hostid> at one time looked like |
| 1162 |
this:</para> |
1215 |
this:</para> |
| 1163 |
|
1216 |
|
| 1164 |
<programlisting>freefall MX 30 mail.crl.net |
1217 |
<programlisting>freefall MX 30 mail.crl.net |
| 1165 |
freefall MX 40 agora.rdrop.com |
1218 |
freefall MX 40 agora.rdrop.com |
| 1166 |
freefall MX 10 freefall.FreeBSD.org |
1219 |
freefall MX 10 freefall.&os;.org |
| 1167 |
freefall MX 20 who.cdrom.com</programlisting> |
1220 |
freefall MX 20 who.cdrom.com</programlisting> |
| 1168 |
|
1221 |
|
| 1169 |
<para>As you can see, <hostid>freefall</hostid> had many MX entries. |
1222 |
<para>As you can see, <hostid>freefall</hostid> had many MX entries. |
|
Lines 1186-1192
Link Here
|
| 1186 |
server) you need to have any mail sent to various workstations |
1239 |
server) you need to have any mail sent to various workstations |
| 1187 |
directed to it. Basically, you want to <quote>claim</quote> any |
1240 |
directed to it. Basically, you want to <quote>claim</quote> any |
| 1188 |
mail for any hostname in your domain (in this case <hostid |
1241 |
mail for any hostname in your domain (in this case <hostid |
| 1189 |
role="fqdn">*.FreeBSD.org</hostid>) and divert it to your mail |
1242 |
role="fqdn">*.&os;.org</hostid>) and divert it to your mail |
| 1190 |
server so your users can receive their mail on |
1243 |
server so your users can receive their mail on |
| 1191 |
the master mail server.</para> |
1244 |
the master mail server.</para> |
| 1192 |
|
1245 |
|
|
Lines 1197-1223
Link Here
|
| 1197 |
|
1250 |
|
| 1198 |
<para>The mailhost you will be using must be the designated mail |
1251 |
<para>The mailhost you will be using must be the designated mail |
| 1199 |
exchanger for each workstation on the network. This is done in |
1252 |
exchanger for each workstation on the network. This is done in |
| 1200 |
your DNS configuration like so:</para> |
1253 |
your <acronym>DNS</acronym> configuration like so:</para> |
| 1201 |
|
1254 |
|
| 1202 |
<programlisting>example.FreeBSD.org A 204.216.27.XX ; Workstation |
1255 |
<programlisting>example.&os;.org A 204.216.27.XX ; Workstation |
| 1203 |
MX 10 hub.FreeBSD.org ; Mailhost</programlisting> |
1256 |
MX 10 hub.&os;.org ; Mailhost</programlisting> |
| 1204 |
|
1257 |
|
| 1205 |
<para>This will redirect mail for the workstation to the mailhost no |
1258 |
<para>This will redirect mail for the workstation to the mailhost no |
| 1206 |
matter where the A record points. The mail is sent to the MX |
1259 |
matter where the A record points. The mail is sent to the MX |
| 1207 |
host.</para> |
1260 |
host.</para> |
| 1208 |
|
1261 |
|
| 1209 |
<para>You cannot do this yourself unless you are running a DNS |
1262 |
<para>You cannot do this yourself unless you are running a |
| 1210 |
server. If you are not, or cannot run your own DNS server, talk |
1263 |
<acronym>DNS</acronym> server. If you are not, or cannot run |
| 1211 |
to your ISP or whoever provides your DNS.</para> |
1264 |
your own <acronym>DNS</acronym> server, talk to your ISP or |
|
|
1265 |
whoever provides your <acronym>DNS</acronym>.</para> |
| 1212 |
|
1266 |
|
| 1213 |
<para>If you are doing virtual email hosting, the following |
1267 |
<para>If you are doing virtual email hosting, the following |
| 1214 |
information will come in handy. For this example, we |
1268 |
information will come in handy. For this example, we will |
| 1215 |
will assume you have a customer with his own domain, in this |
1269 |
assume you have a customer with his own domain, in this case |
| 1216 |
case <hostid role="domainname">customer1.org</hostid>, and you want |
1270 |
<hostid role="domainname">customer1.org</hostid>, and you want |
| 1217 |
all the mail for <hostid role="domainname">customer1.org</hostid> |
1271 |
all the mail for <hostid |
| 1218 |
sent to your mailhost, <hostid |
1272 |
role="domainname">customer1.org</hostid> sent to your mailhost, |
| 1219 |
role="fqdn">mail.myhost.com</hostid>. The entry in your DNS |
1273 |
<hostid role="fqdn">mail.myhost.com</hostid>. The entry in your |
| 1220 |
should look like this:</para> |
1274 |
<acronym>DNS</acronym> should look like this:</para> |
| 1221 |
|
1275 |
|
| 1222 |
<programlisting>customer1.org MX 10 mail.myhost.com</programlisting> |
1276 |
<programlisting>customer1.org MX 10 mail.myhost.com</programlisting> |
| 1223 |
|
1277 |
|
|
Lines 1258-1267
Link Here
|
| 1258 |
<sect1 id="SMTP-UUCP"> |
1312 |
<sect1 id="SMTP-UUCP"> |
| 1259 |
<title>SMTP with UUCP</title> |
1313 |
<title>SMTP with UUCP</title> |
| 1260 |
|
1314 |
|
| 1261 |
<para>The <application>sendmail</application> configuration that ships with FreeBSD is |
1315 |
<para>The <application>sendmail</application> configuration that |
| 1262 |
designed for sites that connect directly to the Internet. Sites |
1316 |
ships with &os; is designed for sites that connect directly to the |
| 1263 |
that wish to exchange their mail via UUCP must install another |
1317 |
Internet. Sites that wish to exchange their mail via UUCP must |
| 1264 |
<application>sendmail</application> configuration file.</para> |
1318 |
install another <application>sendmail</application> configuration |
|
|
1319 |
file.</para> |
| 1265 |
|
1320 |
|
| 1266 |
<para>Tweaking <filename>/etc/mail/sendmail.cf</filename> manually |
1321 |
<para>Tweaking <filename>/etc/mail/sendmail.cf</filename> manually |
| 1267 |
is an advanced topic. <application>sendmail</application> version 8 generates config files |
1322 |
is an advanced topic. <application>sendmail</application> version 8 generates config files |
|
Lines 1271-1279
Link Here
|
| 1271 |
<filename>/usr/src/usr.sbin/sendmail/cf</filename>.</para> |
1326 |
<filename>/usr/src/usr.sbin/sendmail/cf</filename>.</para> |
| 1272 |
|
1327 |
|
| 1273 |
<para>If you did not install your system with full sources, the |
1328 |
<para>If you did not install your system with full sources, the |
| 1274 |
<application>sendmail</application> configuration set has been broken out into a separate source |
1329 |
<application>sendmail</application> configuration set has been |
| 1275 |
distribution tarball. Assuming you have your FreeBSD source code |
1330 |
broken out into a separate source distribution tarball. Assuming |
| 1276 |
CDROM mounted, do:</para> |
1331 |
you have your &os; source code CDROM mounted, do:</para> |
| 1277 |
|
1332 |
|
| 1278 |
<screen>&prompt.root; <userinput>cd /cdrom/src</userinput> |
1333 |
<screen>&prompt.root; <userinput>cd /cdrom/src</userinput> |
| 1279 |
&prompt.root; <userinput>cat scontrib.?? | tar xzf - -C /usr/src/contrib/sendmail</userinput></screen> |
1334 |
&prompt.root; <userinput>cat scontrib.?? | tar xzf - -C /usr/src/contrib/sendmail</userinput></screen> |
|
Lines 1322-1333
Link Here
|
| 1322 |
<para>The lines containing |
1377 |
<para>The lines containing |
| 1323 |
<literal>accept_unresolvable_domains</literal>, |
1378 |
<literal>accept_unresolvable_domains</literal>, |
| 1324 |
<literal>nocanonify</literal>, and |
1379 |
<literal>nocanonify</literal>, and |
| 1325 |
<literal>confDONT_PROBE_INTERFACES</literal> features will |
1380 |
<literal>confDONT_PROBE_INTERFACES</literal> features will prevent |
| 1326 |
prevent any usage of the DNS during mail delivery. The |
1381 |
any usage of the <acronym>DNS</acronym> during mail delivery. The |
| 1327 |
<literal>UUCP_RELAY</literal> clause is needed to support UUCP |
1382 |
<literal>UUCP_RELAY</literal> clause is needed to support UUCP |
| 1328 |
delivery. Simply put an Internet hostname there that is able to |
1383 |
delivery. Simply put an Internet hostname there that is able to |
| 1329 |
handle .UUCP pseudo-domain addresses; most likely, you will |
1384 |
handle .UUCP pseudo-domain addresses; most likely, you will enter |
| 1330 |
enter the mail relay of your ISP there.</para> |
1385 |
the mail relay of your ISP there.</para> |
| 1331 |
|
1386 |
|
| 1332 |
<para>Once you have this, you need an |
1387 |
<para>Once you have this, you need an |
| 1333 |
<filename>/etc/mail/mailertable</filename> file. If you have |
1388 |
<filename>/etc/mail/mailertable</filename> file. If you have |
|
Lines 1597-1603
Link Here
|
| 1597 |
<programlisting>pwcheck_method: passwd</programlisting> |
1652 |
<programlisting>pwcheck_method: passwd</programlisting> |
| 1598 |
|
1653 |
|
| 1599 |
<para>This method will enable <application>sendmail</application> |
1654 |
<para>This method will enable <application>sendmail</application> |
| 1600 |
to authenticate against your FreeBSD <filename>passwd</filename> |
1655 |
to authenticate against your &os; <filename>passwd</filename> |
| 1601 |
database. This saves the trouble of creating a new set of usernames |
1656 |
database. This saves the trouble of creating a new set of usernames |
| 1602 |
and passwords for each user that needs to use |
1657 |
and passwords for each user that needs to use |
| 1603 |
<acronym>SMTP</acronym> authentication, and keeps the login |
1658 |
<acronym>SMTP</acronym> authentication, and keeps the login |
|
Lines 1711-1717
Link Here
|
| 1711 |
way they interact with email; this gives users increased |
1766 |
way they interact with email; this gives users increased |
| 1712 |
functionality and flexibility. &os; contains support for |
1767 |
functionality and flexibility. &os; contains support for |
| 1713 |
numerous mail user agents, all of which can be easily installed |
1768 |
numerous mail user agents, all of which can be easily installed |
| 1714 |
using the <link linkend="ports">FreeBSD Ports Collection</link>. |
1769 |
using the <link linkend="ports">&os; Ports Collection</link>. |
| 1715 |
Users may choose between graphical email clients such as |
1770 |
Users may choose between graphical email clients such as |
| 1716 |
<application>evolution</application> or |
1771 |
<application>evolution</application> or |
| 1717 |
<application>balsa</application>; console based clients such as |
1772 |
<application>balsa</application>; console based clients such as |
|
Lines 2224-2235
Link Here
|
| 2224 |
and places each list in it's own mailbox.</para> |
2279 |
and places each list in it's own mailbox.</para> |
| 2225 |
|
2280 |
|
| 2226 |
<programlisting>:0 |
2281 |
<programlisting>:0 |
| 2227 |
* ^Sender:.owner-freebsd-\/[^@]+@FreeBSD.ORG |
2282 |
* ^Sender:.owner-freebsd-\/[^@]+@&os;.ORG |
| 2228 |
{ |
2283 |
{ |
| 2229 |
LISTNAME=${MATCH} |
2284 |
LISTNAME=${MATCH} |
| 2230 |
:0 |
2285 |
:0 |
| 2231 |
* LISTNAME??^\/[^@]+ |
2286 |
* LISTNAME??^\/[^@]+ |
| 2232 |
FreeBSD-${MATCH} |
2287 |
&os;-${MATCH} |
| 2233 |
}</programlisting> |
2288 |
}</programlisting> |
| 2234 |
</sect1> |
2289 |
</sect1> |
| 2235 |
</chapter> |
2290 |
</chapter> |
|
Lines 2243-2246
Link Here
|
| 2243 |
sgml-always-quote-attributes: t |
2298 |
sgml-always-quote-attributes: t |
| 2244 |
sgml-parent-document: ("../book.sgml" "part" "chapter") |
2299 |
sgml-parent-document: ("../book.sgml" "part" "chapter") |
| 2245 |
End: |
2300 |
End: |
| 2246 |
--> |
2301 |
--> |