⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smtp-uucp.html

📁 FreeBSD操作系统的详细使用手册
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>SMTP with UUCP</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="Electronic Mail" href="mail.html" /><link rel="PREVIOUS" title="Advanced Topics" href="mail-advanced.html" /><link rel="NEXT" title="Setting Up to Send Only" href="outgoing-only.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="mail-advanced.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 22 Electronic Mail</td><td width="10%" align="right" valign="bottom"><a href="outgoing-only.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="SMTP-UUCP" name="SMTP-UUCP">22.7 SMTP with UUCP</a></h1><p>The <b class="APPLICATION">sendmail</b> configuration that ships with FreeBSD isdesigned for sites that connect directly to the Internet. Sites that wish to exchangetheir mail via UUCP must install another <b class="APPLICATION">sendmail</b>configuration file.</p><p>Tweaking <tt class="FILENAME">/etc/mail/sendmail.cf</tt> manually is an advancedtopic. <b class="APPLICATION">sendmail</b> version 8 generates config files via <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=m4&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">m4</span>(1)</span></a> preprocessing,where the actual configuration occurs on a higher abstraction level. The <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=m4&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">m4</span>(1)</span></a> configurationfiles can be found under <tt class="FILENAME">/usr/src/usr.sbin/sendmail/cf</tt>.</p><p>If you did not install your system with full sources, the <bclass="APPLICATION">sendmail</b> configuration set has been broken out into a separatesource distribution tarball. Assuming you have your FreeBSD source code CDROM mounted,do:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cd /cdrom/src</kbd><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">cat scontrib.?? | tar xzf - -C /usr/src/contrib/sendmail</kbd></pre><p>This extracts to only a few hundred kilobytes. The file <ttclass="FILENAME">README</tt> in the <tt class="FILENAME">cf</tt> directory can serve as abasic introduction to <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=m4&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">m4</span>(1)</span></a>configuration.</p><p>The best way to support UUCP delivery is to use the <varclass="LITERAL">mailertable</var> feature. This creates a database that <bclass="APPLICATION">sendmail</b> can use to make routing decisions.</p><p>First, you have to create your <tt class="FILENAME">.mc</tt> file. The directory <ttclass="FILENAME">/usr/src/usr.sbin/sendmail/cf/cf</tt> contains a few examples. Assumingyou have named your file <tt class="FILENAME">foo.mc</tt>, all you need to do in order toconvert it into a valid <tt class="FILENAME">sendmail.cf</tt> is:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">cd /usr/src/usr.sbin/sendmail/cf/cf</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">make foo.cf</kbd><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">cp foo.cf /etc/mail/sendmail.cf</kbd></pre><p>A typical <tt class="FILENAME">.mc</tt> file might look like:</p><pre class="PROGRAMLISTING">VERSIONID(`<var class="REPLACEABLE">Your version number</var>') OSTYPE(bsd4.4)FEATURE(accept_unresolvable_domains)FEATURE(nocanonify)FEATURE(mailertable, `hash -o /etc/mail/mailertable')define(`UUCP_RELAY', <var class="REPLACEABLE">your.uucp.relay</var>)define(`UUCP_MAX_SIZE', 200000)define(`confDONT_PROBE_INTERFACES')MAILER(local)MAILER(smtp)MAILER(uucp)Cw    <var class="REPLACEABLE">your.alias.host.name</var>Cw    <var class="REPLACEABLE">youruucpnodename.UUCP</var></pre><p>The lines containing <var class="LITERAL">accept_unresolvable_domains</var>, <varclass="LITERAL">nocanonify</var>, and <varclass="LITERAL">confDONT_PROBE_INTERFACES</var> features will prevent any usage of theDNS during mail delivery. The <var class="LITERAL">UUCP_RELAY</var> clause is needed tosupport UUCP delivery. Simply put an Internet hostname there that is able to handle .UUCPpseudo-domain addresses; most likely, you will enter the mail relay of your ISPthere.</p><p>Once you have this, you need an <tt class="FILENAME">/etc/mail/mailertable</tt> file.If you have only one link to the outside that is used for all your mails, the followingfile will suffice:</p><pre class="PROGRAMLISTING">## makemap hash /etc/mail/mailertable.db &lt; /etc/mail/mailertable.                             uucp-dom:<var class="REPLACEABLE">your.uucp.relay</var></pre><p>A more complex example might look like this:</p><pre class="PROGRAMLISTING">## makemap hash /etc/mail/mailertable.db &lt; /etc/mail/mailertable#horus.interface-business.de   uucp-dom:horus.interface-business.de        uucp-dom:if-businterface-business.de         uucp-dom:if-bus.heep.sax.de                  smtp8:%1horus.UUCP                    uucp-dom:horusif-bus.UUCP                   uucp-dom:if-bus.                             uucp-dom:</pre><p>The first three lines handle special cases where domain-addressed mail should not besent 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 bedelivered using SMTP. Finally, the UUCP neighbors are mentioned in the .UUCPpseudo-domain notation, to allow for a <var class="LITERAL"><varclass="REPLACEABLE">uucp-neighbor</var> !<var class="REPLACEABLE">recipient</var></var>override of the default rules. The last line is always a single dot, matching everythingelse, with UUCP delivery to a UUCP neighbor that serves as your universal mail gateway tothe world. All of the node names behind the <var class="LITERAL">uucp-dom:</var> keywordmust be valid UUCP neighbors, as you can verify using the command <varclass="LITERAL">uuname</var>.</p><p>As a reminder that this file needs to be converted into a DBM database file beforeuse. The command line to accomplish this is best placed as a comment at the top of the<tt class="FILENAME">mailertable</tt> file. You always have to execute this command eachtime you change your <tt class="FILENAME">mailertable</tt> file.</p><p>Final hint: if you are uncertain whether some particular mail routing would work,remember the <var class="OPTION">-bt</var> option to <b class="APPLICATION">sendmail</b>.It starts <b class="APPLICATION">sendmail</b> in <span class="emphasis"><iclass="EMPHASIS">address test mode</i></span>; simply enter <varclass="LITERAL">3,0</var>, 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 agentwill be called with, and the (possibly translated) address. Leave this mode by typing <bclass="KEYCAP">Ctrl</b>+<b class="KEYCAP">D</b>.</p><pre class="SCREEN"><samp class="PROMPT">%</samp> <kbd class="USERINPUT">sendmail -bt</kbd>ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)Enter &lt;ruleset&gt; &lt;address&gt;<samp class="PROMPT">&gt;</samp> <kbd class="USERINPUT">3,0 foo@example.com</kbd>canonify           input: foo @ example . com...parse            returns: $# uucp-dom $@ <varclass="REPLACEABLE">your.uucp.relay</var> $: foo &lt; @ example . com . &gt;<samp class="PROMPT">&gt;</samp> <kbd class="USERINPUT">^D</kbd></pre></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="mail-advanced.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="outgoing-only.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Advanced Topics</td><td width="34%" align="center" valign="top"><a href="mail.html" accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Setting Up to Send Only</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting &#60;<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>&#62;.<br />For questions about this documentation, e-mail &#60;<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&#62;.</small></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -