/usr/share/doc/newbiedoc/newbiedoc.berlios.de/wiki/Mail_-_retrieving.html is in newbiedoc 0.8.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | <!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" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Mail - retrieving,Amp77,Manager,GNU Free Documentation License,GPLv2,GPLv3,Index" />
<title>Mail - retrieving - NewbieDOC</title>
</head>
<body class="mediawiki ns-4 ltr page-NewbieDOC_Mail_-_retrieving">
<div id="globalWrapper">
<div id="column-content">
<div id="content">
<a name="top" id="top"></a>
<h1 class="firstHeading">Mail - retrieving</h1>
<div id="bodyContent">
<h3 id="siteSub">From NewbieDOC</h3>
<div id="contentSub"></div>
<!-- Bad Behavior 2.0.11 run time: 18.647 ms --><dl><dt><a href="http://newbiedoc.berlios.de/wiki/User:Amp77" title="User:Amp77">Andrei Popescu</a>
</dt><dd>andreimpopescu at gmail dot com (author)
</dd><dt><a href="http://newbiedoc.berlios.de/wiki/User:Manager" title="User:Manager">Chris Lale</a>
</dt><dd>chrislale AT users DOT berlios DOT de (publisher)
</dd></dl>
<p><b>Go to <a href="Index.html" title="NewbieDOC:Index">NewbieDOC index</a></b>
</p><p><b>Revision History</b>
</p>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><hr/>
</td></tr>
<tr>
<td rowspan="2" valign="top">Revision 1.0
</td><td valign="top">14th July 2007
</td><td valign="top">Revised by <a href="http://newbiedoc.berlios.de/wiki/User:Amp77" title="User:Amp77">Andrei Popescu</a>
</td></tr>
<tr>
<td colspan="2" valign="top">Initial release.
</td></tr>
<tr>
<td colspan="3"> <hr/>
</td></tr>
<tr>
<td rowspan="2" valign="top">Revision 1.1
</td><td valign="top">27th November 2007
</td><td valign="top">Revised by <a href="http://newbiedoc.berlios.de/wiki/User:Amp77" title="User:Amp77">Andrei Popescu</a>
</td></tr>
<tr>
<td colspan="2" valign="top">Reformatted for newbiedoc package. Added Revision History, Abstract and License in Appendix.
</td></tr>
<tr>
<td colspan="3"> <hr/>
<p><br />
</p>
<table style="border-color:silver;border-style:solid;border-width:1px 1px 1px 1px;width:100%;text-align:left;margin-bottom:1em;background:#f9f9f9;padding:.3em">
<tr>
<td> <a href="http://newbiedoc.berlios.de/wiki/Image:Newbiedoc-32.png" class="image.html" title="Image:Newbiedoc-32.png"><img alt="Image:Newbiedoc-32.png" src="../images/7/76/Newbiedoc-32.png" width="32" height="32" border="0" /></a>
</td><td> <b></b>
</td><td> <b>Stable document</b>
</td></tr>
<tr>
<td>
</td><td>
</td><td style="width:100%">You can comment on this document by clicking on the <a href="http://newbiedoc.berlios.de/wiki?title=NewbieDOC_talk:Mail_-_retrieving&action=edit" class="external text.html" title="http://newbiedoc.berlios.de/wiki?title=NewbieDOC_talk:Mail_-_retrieving&action=edit" rel="nofollow"><b>discussion</b></a> tab.
<p>You can edit the live version of this document: <a href="http://newbiedoc.berlios.de/wiki/Mail_-_retrieving" class="external text.html" title="http://newbiedoc.berlios.de/wiki/Mail_-_retrieving" rel="nofollow">Mail - retrieving</a>
</p>
</td></tr></table>
<p><br />
<b>Abstract</b>
</p><p>Help for Debian newbies wnting to retrieve mail from a POP account using Getmail.
</p><p><br />
</p>
<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1"><a href="Mail_-_retrieving.html#Introduction"><span class="tocnumber">1</span> <span class="toctext">Introduction</span></a></li>
<li class="toclevel-1"><a href="Mail_-_retrieving.html#Basic_Setup"><span class="tocnumber">2</span> <span class="toctext">Basic Setup</span></a></li>
<li class="toclevel-1"><a href="Mail_-_retrieving.html#getmailrc_-_getmail.27s_configuration_file"><span class="tocnumber">3</span> <span class="toctext">getmailrc - getmail's configuration file</span></a></li>
<li class="toclevel-1"><a href="Mail_-_retrieving.html#Finishing_touch"><span class="tocnumber">4</span> <span class="toctext">Finishing touch</span></a></li>
<li class="toclevel-1"><a href="Mail_-_retrieving.html#Appendix_A:_License"><span class="tocnumber">5</span> <span class="toctext">Appendix A: License</span></a></li>
</ul>
</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
<p><br />
</p>
<a name="Introduction"></a><h2> <span class="mw-headline">1 Introduction </span></h2>
<p>There are many ways to retrieve mail on a Debian GNU/Linux system. Most graphical and even some non-graphical mail clients, also known as MUA (Mail User Agent) can do this. The method I describe below has the big advantage that it does not depend on any MUA. This way you can still receive mail even if your graphical mail client (or whole X) is broken for some reason. (This is almost unheard of with the stable distribution, but can happen if you run unstable).
</p>
<a name="Basic_Setup"></a><h2> <span class="mw-headline">2 Basic Setup </span></h2>
<p>The best known program for this task is fetchmail. While fetchmail can do a lot of things it is not very easy to setup. For this reason I choose getmail. We need to install it first and need to be root for that:
</p>
<pre># aptitude install getmail4</pre>
<p>There is also a getmail package, but it is unmaintained and you shouldn't use it. After completing the installation you can (and should) continue your work from your normal account. First we need to create a directory for getmail's files. The standard location is in your own home directory (Note: I will asume you work from your homedir. If this is not the case then you must prepend something like "~/" to all paths):
</p>
<pre>$ mkdir .getmail</pre>
<p>We also need to create a storage for the mail. A good option is the Maildir format, as it allows different programs to access the storage at the same time (as opposed to mbox). The best way would be to create this using your mail client. If the default storage of your client is not Maildir just look for the "new mailbox" or similar option. Some clients also need a separate plugin in order to use Maildir style storage. The Maildir should best be created in your homedir. Make sure you know the name of the directory as you will need it. I will assume it is 'Maildir'. Another way to create maildirs is to use the program 'maildirmake' from the maildrop package.
</p>
<a name="getmailrc_-_getmail.27s_configuration_file"></a><h2> <span class="mw-headline">3 getmailrc - getmail's configuration file </span></h2>
<p>In order to use getmail we need to tell it some information about our mail account. This goes to the getmailrc file. You will need to create one for each account you want to retrieve mail from. For the moment we will create just one (replace 'mcedit' with your prefered editor):
</p>
<pre>$ mcedit .getmail/getmailrc</pre>
<p>For a typical POP3 account you will need to add something like the following (lines starting with # are just comments):
</p>
<pre>[retriever]
type = SimplePOP3Retriever
server = pop.example.com
username = your_username
password = your_password
[destination]
type = Maildir
path = ~/Maildir/
[options]
# we don't want to retrieve the same messages at each run
# remove the # from the next line *after* you are sure everything is setup ok
#read_all = False
# delete messages from the server 3 days after retrieving them
# or use 'delete = true' instead
# remove the # from the next line *after* you are sure everything is setup ok
#delete_after = 3</pre>
<p>As you can see, the two options are commented out. This is done to prevent loss of mail in the configuration phase. <b>After</b> everything is setup ok you should uncomment them. We also need to make this file unreadable by other users on the system because it contains the password in clear text:
</p>
<pre>$ chmod 600 .getmail/getmailrc</pre>
<p>We can test the configuration by invoking getmail with no arguments. The result should look like the following:
</p>
<pre>~$ getmail
getmail version 4.6.5
Copyright (C) 1998-2006 Charles Cazabon. Licensed under the GNU GPL version 2.
SimplePOP3Retriever:your_username@pop.example.com:110:
msg 1/1 (3622 bytes) delivered
1 messages retrieved, 0 skipped</pre>
<p>Getmail retrieved the message number 1 from a total of 1. Use your mail client to read the mail. You might need to tell it to refresh folders to see the new mail (pressing the Receive/Get Mail button might be enough). If you have many messages waiting on your server you should interrupt getmail after retrieving a couple of them by using Ctrl C if you don't want all messages retrieved many times. This is only needed in the test phase, because later we will enable the necessary options in getmailrc. If the test was ok then we need some final steps.
</p>
<a name="Finishing_touch"></a><h2> <span class="mw-headline">4 Finishing touch </span></h2>
<p>Obviously, we should first enable the two options in getmailrc to prevent duplicate messages. If you don't want to run getmail occasionaly (by invoking it from commandline) there is one more thing to do. Following unix philosophy, getmail does not include the possibility to run automaticaly at specified intervals, but relies on cron for that. Cron should already be installed and running on your system, so all you need is to setup a "crontab". Crontabs are just text files in a special location, but you should only create/edit them with the following command:
</p>
<pre>$ crontab -e</pre>
<p>Depending on how your system is setup, the editor vi might be the one used. If this is not what you want (type ":q" whitout the quotes and press Enter to exit vi) then use the following (replace 'mcedit' with your prefered editor, of course):
</p>
<pre>$ EDITOR=mcedit crontab -e</pre>
<p>For an interval of 10 minutes, your crontab should look like this:
</p>
<pre># m h dom mon dow command
0-59/10 * * * * /usr/bin/getmail --quiet</pre>
<a name="Appendix_A:_License"></a><h2> <span class="mw-headline">5 Appendix A: License </span></h2>
<p>Copyright (c)2007 <a href="http://newbiedoc.berlios.de/wiki/User:Amp77" title="User:Amp77">Andrei Popescu</a>, andreimpopescu at gmail dot com
</p>
<table style="width:80%; background-color:#e8f8e8; border:1px solid #80d080; padding:5px; clear:both; margin:0.5em auto; text-align:center;">
<tr>
<td> <i>This document has been released by the author under a <b>Free license</b> (which should be indicated beneath this notice). You may use it freely according to its particular license.</i>
<p><b>Free Software License:</b> <i>Either GNU FDL or GNU GPL at your choice.</i>
</p>
</td></tr></table>
<table style="background-color: transparent" cellspacing="0" cellpadding="0">
<tr>
<td>
<table style="margin: 0.5em auto; width: 80%; background-color: #f8f8f8; border: 2px solid #e0e0e0; padding: 5px">
<tr>
<td> <a href="http://newbiedoc.berlios.de/wiki/Image:Reiss-head-sm.jpg" class="image.html" title="GNU FDL"><img alt="GNU FDL" src="../images/thumb/7/7c/Reiss-head-sm.jpg/64px-Reiss-head-sm.jpg" width="64" height="62" border="0" /></a>
</td><td> <i>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "<a href="http://newbiedoc.berlios.de/wiki/GNU_Free_Documentation_License.html" title="NewbieDOC:GNU Free Documentation License">GNU Free Documentation License</a>."</i>
</td></tr></table>
</td></tr></table>
<table style="background-color: transparent" cellspacing="0" cellpadding="0">
<tr>
<td>
<table style="margin: 0.5em auto; width: 80%; background-color: #f7f8ff;border; border: 2px solid #8888aa; padding: 5px">
<tr>
<td> <a href="http://newbiedoc.berlios.de/wiki/Image:Reiss-head-sm.jpg" class="image.html" title="GPL"><img alt="GPL" src="../images/thumb/7/7c/Reiss-head-sm.jpg/64px-Reiss-head-sm.jpg" width="64" height="62" border="0" /></a>
</td><td> <i>This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either <a href="http://newbiedoc.berlios.de/wiki/GPLv2.html" title="NewbieDOC:GPLv2">version 2</a> of the License, or (at your option) any <a href="http://newbiedoc.berlios.de/wiki/NewbieDOC:GPLv3" title="NewbieDOC:GPLv3">later version</a>.</i>
<p>This work is distributed in the hope that it will be useful, but <b>without any warranty</b>; without even the implied warranty of <b>merchantability</b> or <b>fitness for a particular purpose</b>. See the <a href="http://www.gnu.org/copyleft/gpl.html" class="external text.html" title="http://www.gnu.org/copyleft/gpl.html" rel="nofollow">GNU General Public License</a> for more details. You should have received a copy of the GNU General Public License along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA<i></i>
</p>
</td></tr></table>
</td></tr></table>
<p><b>Go to <a href="Index.html" title="NewbieDOC:Index">NewbieDOC index</a></b>
</p>
</td>
</tr>
</table>
<!-- Tidy found serious XHTML errors -->
<!--
Pre-expand include size: 3542 bytes
Post-expand include size: 3174 bytes
Template argument size: 336 bytes
Maximum: 2097152 bytes
-->
<div class="printfooter">
<hr/>
Retrieved from "<a href="http://newbiedoc.berlios.de/wiki/Mail_-_retrieving">http://newbiedoc.berlios.de/wiki/NewbieDOC:Mail_-_retrieving</a>"</div>
Content is available under <a href="http://www.gnu.org/copyleft/fdl.html" class="external " title="http://www.gnu.org/copyleft/fdl.html" rel="nofollow">GNU Free Documentation License 1.2</a>, unless otherwise stated.</div></div></div></div></body></html>
|