<?xml version="1.0"?>
<rss version="2.0.">
  <channel>
    <title>Advogato blog for jasper</title>
    <link>http://www.advogato.org/person/jasper/</link>
    <description>Advogato blog for jasper</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Sat, 17 May 2008 15:58:10 GMT</pubDate>
    <item>
      <pubDate>Tue, 6 Jun 2000 20:58:09 GMT</pubDate>
      <title>6 Jun 2000</title>
      <link>http://www.advogato.org/person/jasper/diary.html?start=2</link>
      <guid>http://www.advogato.org/person/jasper/diary.html?start=2</guid>
      <description>&lt;P&gt;Oops, Jerzy Balamut, the solid pop3 author pointed out
that the pop3 protocol dosn't count bytes stuffed line
beginings in the size returned by the LIST and STAT
commands. I checked the &lt;A
HREF="http://www.rfc.net/"&gt;RFC's&lt;/a&gt;, and he's right.

&lt;p&gt; &lt;P&gt;It's not that bad actually, cos i've been thinking about
writing a script that takes a mail on stdin and writes it
into a maildir with the right line endings etc.

&lt;p&gt; &lt;P&gt;It's needed for MTA's that arn't as flexable as exim, and
i can now encode the file size &lt;I&gt;without&lt;/i&gt; byte stuffed
line beginings in the filename (a bit of a hack, but not a
problem).

</description>
    </item>
    <item>
      <pubDate>Fri, 26 May 2000 22:55:16 GMT</pubDate>
      <title>26 May 2000</title>
      <link>http://www.advogato.org/person/jasper/diary.html?start=1</link>
      <guid>http://www.advogato.org/person/jasper/diary.html?start=1</guid>
      <description>&lt;P&gt;got TOP working, and made exim 'byte-stuff' lines with a
single '.' (which is how the pop server tells the client
that it's finished sending the mail).

&lt;p&gt; &lt;P&gt;It all seems to work! (and, more importantly, is RFC
complient).

&lt;p&gt; &lt;P&gt;Now it's supper time ;-)

</description>
    </item>
    <item>
      <pubDate>Fri, 26 May 2000 18:49:22 GMT</pubDate>
      <title>26 May 2000</title>
      <link>http://www.advogato.org/person/jasper/diary.html?start=0</link>
      <guid>http://www.advogato.org/person/jasper/diary.html?start=0</guid>
      <description>&lt;P&gt;I'm setting up a high capacity pop server to replace one
thats thrashing it's self to death at the moment, so I've
been trying to find the most efficent pop server for what I
want to do.

&lt;p&gt; &lt;P&gt;At the moment we are running &lt;A 
HREF="http://freshmeat.net/appindex/1998/07/01/899324347.html"&gt;&lt;I&gt;qpopper&lt;/i&gt;&lt;/a&gt;,
but if a mailbox gets above 50Mb or so the server really
slows down as &lt;I&gt;qpopper&lt;/i&gt; copies the entire mailbox
before and after a user transfers their mail.

&lt;p&gt; &lt;P&gt;We need a system that works well with:

&lt;p&gt; &lt;UL&gt;
&lt;LI&gt;Large (50Mb+) mailboxes
&lt;LI&gt;Many users accessing large mailboxes at the same
time
&lt;/ul&gt;

&lt;p&gt; &lt;P&gt;To get around the problem of large mailboxes I want a pop
server that uses &lt;I&gt;maildir&lt;/i&gt;, and for vairous reasons I
want one that runs standalone, i.e. &lt;b&gt;not&lt;/b&gt; through
&lt;i&gt;inetd&lt;/i&gt;.

&lt;p&gt; &lt;P&gt;After some searching through vairous mailing list
archives and &lt;A 
HREF="http://freshmeat.net/appindex/daemons/pop3.html"&gt;freshmeat&lt;/a&gt;
I decided upon &lt;A
HREF="http://freshmeat.net/appindex/1999/11/12/942422548.html"&gt;&lt;I&gt;Solid
POP3&lt;/i&gt;&lt;/a&gt;.

&lt;p&gt; &lt;P&gt;The problem now is that the wire-format for &lt;A  
HREF="http://www.rfc.net/get2.php3/std53.html"&gt;POP3&lt;/a&gt; has
all line endings as \r\n, where as the normal unix line
endings are just \n. This means you have to scan through
each message to get a count of the lines so you can account
for transmitting all the line endings as \r\n - you need to
know the size of each message so you can give the right
responce to the LIST command.

&lt;p&gt; &lt;P&gt;With the test mailbox I was using (an excessive 1Gb in
size and 329 messages) this takes 2 minutes!, which is
&lt;B&gt;WAY&lt;/b&gt; to long as far as user interactivity goes!

&lt;p&gt; &lt;P&gt;Now, since the only processes that are going to be
touching these mailboxes are the MTA i'm using (&lt;A
HREF="http://www.exim.org"&gt;exim&lt;/a&gt;), and the pop server I
could do whatever I wanted with the mailbox format.

&lt;p&gt; &lt;P&gt;I set up exim to deliver all the mails with \r\n line
endings, and then created a new mailbox type in the solid
pop3 source, crlf_maildir.

&lt;p&gt; &lt;P&gt;Since we don't need to munge the line endings any more
all we have to do for tha vairous pop commands is:

&lt;p&gt; &lt;UL&gt;
&lt;LI&gt;Getting the data for LIST is just a question of looping
through &lt;I&gt;readdir&lt;/i&gt; and &lt;I&gt;stat&lt;/i&gt;'ing each file
for it's size.
&lt;LI&gt;RETR is just a  &lt;I&gt;mmap&lt;/i&gt; and &lt;I&gt;write&lt;/i&gt;.
&lt;LI&gt;TOP is just &lt;I&gt;mmap&lt;/i&gt;, loop through counting line
endings, and then &lt;I&gt;write&lt;/i&gt;. (&lt;I&gt;fetchmail&lt;/i&gt; uses TOP
&amp;lt;msg&amp;gt; 99999999, and so might other pop clients, so if
we check to see if no. of lines &amp;gt;= size of message we can
just chuck out the message as a whole...)
&lt;LI&gt;... and everything else is as before
&lt;/ul&gt;

&lt;p&gt; &lt;P&gt;I've implemented most of this, and it now takes less than
a second to authenticate a client, rather than 2 minute,
which is a nice imporvement ;-)

&lt;p&gt; &lt;P&gt;Expect to see a new version of Solid POP3 soon!

&lt;p&gt; &lt;I&gt;&lt;/i&gt;&lt;I&gt;&lt;/i&gt;&lt;I&gt;&lt;/i&gt;</description>
    </item>
  </channel>
</rss>
