Updated the web page to refer to the current versions.
[stand.git] / index.html
blobbdf56e43c358d002459aed68c4adef675a7d79d2
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8">
5 <title>Stand - A Very Simple POP3 Client</title>
6 <link rel="stylesheet" type="text/css" href="../style.css" title="mainstyle">
7 </head>
9 <body>
10 <h2><a name="stand">Stand - A Very Simple POP3 Client</a></h2>
11 <h4><a name="just-hand-over-the-mail">(previously known as Just Hand Over The Mail)</a></h4>
13 <!-- <h3><a href="http://repo.or.cz/w/stand.git?a=blob_plain;f=stand;hb=master">Download</a></h3> -->
14 <h3><a href="http://repo.or.cz/w/stand.git?a=blob_plain;f=stand;hb=ee9efca0408c19f13e400fffcb9a753b016fc0af">Download</a></h3>
16 <p>
17 This is a small Ruby script for fetching mail from POP3 servers
18 and delivering them to some LDA (Local Delivery Agent, typically
19 <a href="http://www.procmail.org/">procmail</a>, although <a href="http://rrt.sc3d.org/">Reuben
20 Thomas</a>
21 recommends <a
22 href="http://www.courier-mta.org/maildrop/">maildrop</a>). It
23 does APOP authentication and SSL-wrapped POP3. I first
24 wrote it out of frustration with <a
25 href="http://www.catb.org/~esr/fetchmail/">fetchmail</a> which
26 has a huge number of problems with the essentially very simple
27 task of fetching mail from a POP3 server.
28 </p>
30 <p>
31 If you're using Debian, it depends on the following packages:
32 </p>
33 <ul>
34 <li>ruby1.8</li>
35 <li>libruby1.8</li>
36 <li>libopenssl-ruby</li>
37 <li>libsqlite3-ruby</li>
38 </ul>
39 <p>
40 If you're using the sarge versions of libruby1.8 and
41 libopenssl-ruby, you will have to use slightly different
42 versions of this script. There is more about this below.
43 </p>
45 <p>I used nothing but the original script for dealing with my
46 email for some years, but this is a brand new version based
47 largely on the work of <a href="http://rrt.sc3d.org">Reuben</a>,
48 who kindly took an interest in it. As as result the code is now
49 less than a third of its original size.
50 </p>
52 <!--
53 Some of the changes that he and I made included:
54 </p>
56 <ul>
58 <li>Removing the file locking code, and replacing it with calls
59 to programs in lockfile-progs.</li>
61 <li>Removing the option for writing directly to mboxes, and only
62 allow the piping of mail commands.</li>
64 <li>Removing the configuration file parsing code and making the
65 configuration file YAML based.
66 </li>
68 <li>Removing the UIDL caching. This is the change I'm probably
69 least happy about, but since I don't use this facility any more
70 and Reuben and I are the only known users of this script, there
71 doesn't seem any point in keeping code that neither of us ever
72 use. I will keep the other version on a branch, so if you're
73 interested in it, please email me.
74 </li>
76 <li>The behaviour is now to delete each message from the POP3
77 server once it has been successfully delivered to the LDA.</li>
79 <li>The original version used my own POP3 interface code, but
80 this one just uses the ruby pop module.</li>
82 </ul>
84 -->
86 <p>By default, stand deletes each message once it has been
87 successfully delivered to the LDA so use a reliable LDA (such as
88 procmail or maildrop) or you could easily lose mail.</p>
90 <p>
91 stand uses a YAML configuration file called
92 <tt>~/.stand.yaml</tt> that looks like this:
93 </p>
95 <pre>
96 # Comments start with `#'; leave a blank line between each
97 # account's details. The Host, User and Pass lines are
98 # required. Command defaults to "procmail -f-".
100 # For testing tpop3d:
103 Host: localhost
104 User: a@b.c
105 Pass: not-my-password
106 Command: procmail -f-
107 APOP: yes
110 Host: secure.mythic-beasts.com
111 SSL: yes
112 User: mark
113 Pass: not-my-password-either
114 Command: procmail -f-
117 Host: pop.clara.net
118 User: mark.longair
119 Pass: something-else
120 Command: procmail -f-
121 </pre>
124 The usage message (and the script itself) should tell you
125 anything else you need to know.
126 </p>
128 <p>Please bear in mind that it's quite possible that there may
129 be bugs in these scripts that will cause you to lose mail; use
130 this at your own risk. You can download the most recent version
131 here: <a
132 href="http://repo.or.cz/w/stand.git?a=blob_plain;f=stand;hb=ee9efca0408c19f13e400fffcb9a753b016fc0af">stand</a>
133 or from the link at the top of the page. If you get an
134 unexpected error or timeout and you have older versions of the
135 Ruby libraries, you should try <a
136 href="http://repo.or.cz/w/stand.git?a=blob_plain;f=stand;hb=6c59195b570d838ee9d2302e14541535f55fc004">this version
137 instead</a>.
138 </p>
141 This issue with the SSL-wrapped POP3 using the Ruby pop module
142 is annoying and we are planning to replace that by using
143 <tt>stunnel</tt> or <tt>openssl</tt>. In addition, there's no
144 easy way to suppress the warning:
145 </p>
147 <pre>
148 /home/mark/bin/stand:46: warning: using default DH parameters.
149 </pre>
152 ... that you get from libopenssl-ruby.
153 </p>
155 <!--
157 <p style="font-style: smaller">
158 For the record, my chief problems with fetchmail are below.
159 These may no longer be true, in which case please correct me.
160 </p>
162 <ol style="font-style: smaller">
164 <li>There are lots of broken POP3 servers out there, some of which I
165 have to use (trying to persuade ISPs to fix non-working POP3 servers
166 turns out to be a thankless and unproductive task.) fetchmail doesn't
167 deal well with these servers. For instance, it tries by default to use
168 the <tt>LAST</tt> command (which was removed in RFC1725) to work out
169 which messages have already been downloaded. The problem with this is
170 that POP3 servers often don't implement <tt>LAST</tt> correctly; you
171 have to recompile fetchmail to force it to always use UIDLs instead.
172 Another issue is that by default it tries to use <tt>TOP 1 99999999</tt>
173 rather than <tt>RETR</tt> to retrieve emails. I'm not sure where that
174 particular idiom came from, but my current ISP's POP3 server hangs the
175 connection in response to requests for huge numbers of lines with
176 <tt>TOP</tt>.</li>
178 <li>It does much more than I need it to: fetching mail from a POP3
179 maildrop is essentially very simple, and it doesn't take long to write a
180 script (like the one below) which does eveything I need from it.</li>
182 <li>I don't like the format of the .fetchmailrc file. I think it's
183 unclear, and the `natural language' style features of the configuration
184 file format strike me as pointless and confusing.</li>
186 <li>I like to be able to have the same configuration file describing my
187 POP3 accounts checked out on many different shell accounts. Then, I
188 want to be able to decide with a command line switch whether to leave
189 messages on the server or not. fetchmail doesn't provide this facility
190 by default; I think the easiest way get that effect is to have two
191 different configuration files, one of which specifies `keep' and the
192 other which doesn't. Obviously that's hardly ideal...</li>
194 <li>The non-SSL builds of fetchmail (e.g. the standard Debian one) don't
195 make it clear that they're unable to do SSL when you specify that a
196 server requires SSL.</li>
198 <li>I can see that the choice to forward retrieved mail to the local
199 SMTP port makes sense for fetchmail, but in the very simple situations I
200 want to deal with, that choice unnecessarily involves an extra (and
201 typically very complex) piece of software.</li>
203 <li>I've heard many anecdotal reports of problems with fetchmail, in
204 areas ranging from the daemon mode (which I gave up on quickly in any
205 case, because of its tendency to get stuck) to the default configuration
206 losing mail... (To be fair, though, I'm not sure of the details of the
207 latter.)</li>
209 </ol>
211 Of course, I've played with recompiled versions of fetchmail that
212 address some of these issues, but I doubt my patches would be accepted
213 upstream. For instance, the discussion of the <tt>LAST</tt> issue in
214 <tt>fetchmail(1)</tt> suggests that my patch to never use <tt>LAST</tt>
215 would be rejected on the grounds that <a
216 href="http://www.tuxedo.org/~esr/">ESR</a> (bizarrely) thinks it's a
217 Good Thing.
219 Of course, I could switch to a different POP3 client, such as <a
220 href="http://www.qcc.sk.ca/~charlesc/software/getmail-2.0/">getmail</a>
221 but given that (a) it's a very simple task I want the program to do and
222 (b) I know exactly how I want it to behave, I just went ahead and did my
223 own version. This was originally called
224 "just-hand-over-the-mail" but Reuben made the excellent
225 suggestion that it should be called "stand", as in "stand and
226 deliver" :)
230 <div class="footer">
231 <hr>
233 Mark Longair - <a
234 href="mailto:mark-software@mythic-beasts.com">bugs or
235 suggestions?</a> (<a
236 href="http://validator.w3.org/check/referer">validate HTML</a> |
238 href="http://jigsaw.w3.org/css-validator/check/referer">validate
239 CSS</a>)
240 </p>
241 </div>
243 </body>
245 </html>