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

📄 smtp-dialup.html

📁 这是很好的学习嵌入式LINUX的文章
💻 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>Using Mail with a Dialup Connection</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="Setting Up to Send Only" href="outgoing-only.html" /><link rel="NEXT" title="SMTP Authentication" href="smtp-auth.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="outgoing-only.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="smtp-auth.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="SMTP-DIALUP" name="SMTP-DIALUP">22.9 Using Mail with a DialupConnection</a></h1><p>If you have a static IP address, you should not need to adjust anything from thedefaults. Set your host name to your assigned Internet name and <bclass="APPLICATION">sendmail</b> will do the rest.</p><p>If you have a dynamically assigned IP number and use a dialup PPP connection to theInternet, you will probably have a mailbox on your ISPs mail server. Let's assume yourISP's domain is <tt class="HOSTID">example.net</tt>, and that your user name is <ttclass="USERNAME">user</tt>, you have called your machine <ttclass="HOSTID">bsd.home</tt>, and your ISP has told you that you may use <ttclass="HOSTID">relay.example.net</tt> as a mail relay.</p><p>In order to retrieve mail from your mailbox, you must install a retrieval agent. The<b class="APPLICATION">fetchmail</b> utility is a good choice as it supports manydifferent protocols. This program is available as a package or from the ports collection(<a href="http://www.FreeBSD.org/cgi/url.cgi?ports/mail/fetchmail/pkg-descr"><ttclass="FILENAME">mail/fetchmail</tt></a>). Usually, your <acronymclass="ACRONYM">ISP</acronym> will provide <acronym class="ACRONYM">POP</acronym>. If youare using user <acronym class="ACRONYM">PPP</acronym>, you can automatically fetch yourmail when an Internet connection is established with the following entry in <ttclass="FILENAME">/etc/ppp/ppp.linkup</tt>:</p><pre class="PROGRAMLISTING">MYADDR:!bg su user -c fetchmail</pre><p>If you are using <b class="APPLICATION">sendmail</b> (as shown below) to deliver mailto non-local accounts, you probably want to have <b class="APPLICATION">sendmail</b>process your mailqueue as soon as your Internet connection is established. To do this,put this command after the <tt class="COMMAND">fetchmail</tt> command in <ttclass="FILENAME">/etc/ppp/ppp.linkup</tt>:</p><pre class="PROGRAMLISTING">  !bg su user -c "sendmail -q"</pre><p>Assume that you have an account for <tt class="USERNAME">user</tt> on <ttclass="HOSTID">bsd.home</tt>. In the home directory of <tt class="USERNAME">user</tt> on<tt class="HOSTID">bsd.home</tt>, create a <tt class="FILENAME">.fetchmailrc</tt>file:</p><pre class="PROGRAMLISTING">poll example.net protocol pop3 fetchall pass MySecret</pre><p>This file should not be readable by anyone except <tt class="USERNAME">user</tt> as itcontains the password <var class="LITERAL">MySecret</var>.</p><p>In order to send mail with the correct <var class="LITERAL">from:</var> header, youmust tell <b class="APPLICATION">sendmail</b> to use <varclass="LITERAL">user@example.net</var> rather than <varclass="LITERAL">user@bsd.home</var>. You may also wish to tell <bclass="APPLICATION">sendmail</b> to send all mail via <ttclass="HOSTID">relay.example.net</tt>, allowing quicker mail transmission.</p><p>The following <tt class="FILENAME">.mc</tt> file should suffice:</p><pre class="PROGRAMLISTING">VERSIONID(`bsd.home.mc version 1.0')OSTYPE(bsd4.4)dnlFEATURE(nouucp)dnlMAILER(local)dnlMAILER(smtp)dnlCwlocalhostCwbsd.homeMASQUERADE_AS(`example.net')dnlFEATURE(allmasquerade)dnlFEATURE(masquerade_envelope)dnlFEATURE(nocanonify)dnlFEATURE(nodns)dnldefine(`SMART_HOST', `relay.example.net')Dmbsd.homedefine(`confDOMAIN_NAME',`bsd.home')dnldefine(`confDELIVERY_MODE',`deferred')dnl</pre><p>Refer to the previous section for details of how to turn this <ttclass="FILENAME">.mc</tt> file into a <tt class="FILENAME">sendmail.cf</tt> file. Also,do not forget to restart <b class="APPLICATION">sendmail</b> after updating <ttclass="FILENAME">sendmail.cf</tt>.</p></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="outgoing-only.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="smtp-auth.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Setting Up to Send Only</td><td width="34%" align="center" valign="top"><a href="mail.html" accesskey="U">Up</a></td><td width="33%" align="right" valign="top">SMTP Authentication</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 + -