📄 mail-fetchmail.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 fetchmail</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD 使用手册" href="index.html" /><link rel="UP" title="电子邮件" href="mail.html" /><link rel="PREVIOUS" title="Mail User Agents" href="mail-agents.html" /><link rel="NEXT" title="Using procmail" href="mail-procmail.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /><meta http-equiv="Content-Type" content="text/html; charset=GB2312" /></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 使用手册</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="mail-agents.html"accesskey="P">后退</a></td><td width="80%" align="center" valign="bottom">章 22. 电子邮件</td><td width="10%" align="right" valign="bottom"><a href="mail-procmail.html"accesskey="N">前进</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="MAIL-FETCHMAIL" name="MAIL-FETCHMAIL">22.12. Usingfetchmail</a></h1><i class="AUTHORGROUP"><span class="CONTRIB">Contributed by</span> Marc Silver.</i> <p><b class="APPLICATION">fetchmail</b> is a full-featured <acronymclass="ACRONYM">IMAP</acronym> and <acronym class="ACRONYM">POP</acronym> client whichallows users to automatically download mail from remote <acronymclass="ACRONYM">IMAP</acronym> and <acronym class="ACRONYM">POP</acronym> servers andsave it into local mailboxes; there it can be accessed more easily. <bclass="APPLICATION">fetchmail</b> can be installed using the <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/mail/fetchmail/pkg-descr"><ttclass="FILENAME">mail/fetchmail</tt></a> port, and offers various features, some of whichinclude:</p><ul><li><p>Support of <acronym class="ACRONYM">POP3</acronym>, <acronymclass="ACRONYM">APOP</acronym>, <acronym class="ACRONYM">KPOP</acronym>, <acronymclass="ACRONYM">IMAP</acronym>, <acronym class="ACRONYM">ETRN</acronym> and <acronymclass="ACRONYM">ODMR</acronym> protocols.</p></li><li><p>Ability to forward mail using <acronym class="ACRONYM">SMTP</acronym>, which allowsfiltering, forwarding, and aliasing to function normally.</p></li><li><p>May be run in daemon mode to check periodically for new messages.</p></li><li><p>Can retrieve multiple mailboxes and forward them based on configuration, to differentlocal users.</p></li></ul><p>While it is outside the scope of this document to explain all of <bclass="APPLICATION">fetchmail</b>'s features, some basic features will be explained. The<b class="APPLICATION">fetchmail</b> utility requires a configuration file known as <ttclass="FILENAME">.fetchmailrc</tt>, in order to run correctly. This file includes serverinformation as well as login credentials. Due to the sensitive nature of the contents ofthis file, it is advisable to make it readable only by the owner, with the followingcommand:</p><pre class="SCREEN"><samp class="PROMPT">%</samp> <kbd class="USERINPUT">chmod 600 .fetchmailrc</kbd></pre><p>The following <tt class="FILENAME">.fetchmailrc</tt> serves as an example fordownloading a single user mailbox using <acronym class="ACRONYM">POP</acronym>. It tells<b class="APPLICATION">fetchmail</b> to connect to <tt class="HOSTID">example.com</tt>using a username of <tt class="USERNAME">joesoap</tt> and a password of <varclass="LITERAL">XXX</var>. This example assumes that the user <ttclass="USERNAME">joesoap</tt> is also a user on the local system.</p><pre class="PROGRAMLISTING">poll example.com protocol pop3 username "joesoap" password "XXX"</pre><p>The next example connects to multiple <acronym class="ACRONYM">POP</acronym> and<acronym class="ACRONYM">IMAP</acronym> servers and redirects to different localusernames where applicable:</p><pre class="PROGRAMLISTING">poll example.com proto pop3:user "joesoap", with password "XXX", is "jsoap" here;user "andrea", with password "XXXX";poll example2.net proto imap:user "john", with password "XXXXX", is "myth" here;</pre><p>The <b class="APPLICATION">fetchmail</b> utility can be run in daemon mode by runningit with the <var class="OPTION">-d</var> flag, followed by the interval (in seconds) that<b class="APPLICATION">fetchmail</b> should poll servers listed in the <ttclass="FILENAME">.fetchmailrc</tt> file. The following example would cause <bclass="APPLICATION">fetchmail</b> to poll every 60 seconds:</p><pre class="SCREEN"><samp class="PROMPT">%</samp> <kbd class="USERINPUT">fetchmail -d 60</kbd></pre><p>More information on <b class="APPLICATION">fetchmail</b> can be found at <ahref="http://www.catb.org/~esr/fetchmail/"target="_top">http://www.catb.org/~esr/fetchmail/</a>.</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="mail-agents.html"accesskey="P">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">起点</a></td><td width="33%" align="right" valign="top"><a href="mail-procmail.html"accesskey="N">前进</a></td></tr><tr><td width="33%" align="left" valign="top">Mail User Agents</td><td width="34%" align="center" valign="top"><a href="mail.html"accesskey="U">上一级</a></td><td width="33%" align="right" valign="top">Using procmail</td></tr></table></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -