<document>

<title>acmemail 2.2.2 documentation</title>
<author>Leon Brocard, Mark Fowler, Simon Wistow</author>
<date>15th April 2000</date>

<section name="Introduction">

 <p>
  acmemail is a webmail application written in Perl. It enables
  multiple users to check their mail (residing on a POP3 or IMAP
  mail server) via the web using their web browser. Requirements:
  a web server, CGI access, Perl.
 </p>

 <p>
  Quite a few such webmail applications exist -- features which separate
  acmemail from the competition include the fact that it 
  fully supports MIME messages, that is has a "pretty" user interface,
  and that security is very important to the development team.
 </p>

 <p>
  acmemail doesn't aim to compete with Hotmail or any other such free
  email site at the moment because you need to have an existing
  POP3 email account, CGI access on a web server, and currently 
  quite a bit of spare time to set it up. This may change in the future.
 </p>
 
 <p>
  The motivation for developing acmemail came from the fact that
  the company I was working for at the time had a very restrictive firewall.
  This meant that I couldn't check my mail from the outside. In this
  case both the POP3 server and the web server that acmemail was
  running on were behind the firewall -- which didn't let POP3 out, but did
  however let the web server serve pages to the outside world.
  Hence the need for a light-weight webmail solution.
 </p>

 <p>
  acmemail's target market is small companies, departments, universities
  and even ISPs that wish to provide a webmail solution for their users.
  Note that its scalability has not been fully tested, although it <emph>is</emph>
  being used at a free UK ISP.
 </p>

 <p>
  The 2.0.x acmemail release (quite old now) had fairly limited 
  capabilities: it was single user, could only handle POP3 servers,
  was hard to configure, and had little documentation.
 </p>

 <p>
  The 2.2.x acmemail release is much more capable: it is multiuser,
  can use files or a real database to handle sessions, can handle IMAP
  servers and there have been a large number of bug fixes, as well
  as performance and security improvements.
 </p>

 <p>
  However, it is still quite hard to customize acmemail and a
  great many changes are planned for the next version, code-named
  "Project Sparkle". Read about it in the section named "The future: Project Sparkle".
  We live in very exciting times.
 </p>

 <p>
  And remember, it's "acmemail", not "Acmemail"!
 </p>
</section>

<section name="Features">

 <p>
  acmemail has the following features:
 </p>

 <list>
  <item>Multiuser</item>
  <item>Handles POP3 and IMAP servers</item>
  <item>Deals with MIME attachments in rather sexy way</item>
  <item>Does not use JavaScript or other strange things,
  so it is perfectly usable under links, lynx, w3m and other browsers</item>
  <item>Sends, Replies [to all]{0,1}, forwards mail</item>
  <item>Takes advantage of mod_perl if available</item>
  <item>Can use a database (such as MySQL or PostgreSQL) to speed up session retrieval</item>
  <item>Can force usage of cookies or disabling of JavaScript for
        security reasons</item>
  <item>Makes tea</item>
 </list>
 <p>
  The last one may not be true.
 </p>
</section>

<section name="Requirements">

 <p>
  acmemail currently requires a number of programs to be installed.
  In fact, it mostly needs services rather than specific programs, so
  when necessary we'll list programs that acmemail has been developed 
  with.
 </p>

 <list>
  <item>Perl 5 must be installed (ideally Perl 5.005_03)</item>
  <item>Lots of Perl modules need to be installed</item>
  <item>A web server with CGI access. Apache is a common choice here
        for scalability reasons so most examples mention that, however
        acmemail has also been tested under boa, thttpd and mathopd</item>
  <item>A POP3 or IMAP server. The University of Washington servers seems
        to be the most used, although the Cyrus IMAP server is also being
        tested</item>
  <item>An SMTP server (in order to send mail). Sendmail and Exim are the
        default choices here, although qmail has also been tested</item>
  <item>Optional: a database server. For anything above a very low use of acmemail,
        a database can be used to store session information. Any database
        that the Perl DBI (a database-independent interface) supports 
        can be used, but the most popular choice is MySQL. PostgeSQL has
        also been tested</item>
 </list>

 <p>
  The most common platform used to develop acmemail is Linux, Apache,
  the University of Washington IMAP server, and sendmail or Exim. There
  is no real reason why acmemail shouldn't run under a non-Unix system
  such as Windows or MacOS -- we just haven't tried it ourselves. Feel
  free to do so and tell us how it went!
 </p>
</section>

<section name="Availability">
 <p>
  acmemail is freely available from its 
   <link xml:link="simple" description="web site" href="http://www.astray.com/acmemail/"/>.
 </p>
</section>

<section name="How to install acmemail 2.2.2 on a fresh Red Hat Linux 6.1 box">

 <p>
  Installing acmemail is unfortunately quite a hard and long task.
  As we don't believe in reinventing the wheel, we use a lot of
  Perl modules from CPAN. All of these have to be installed, including
  the rather troublesome "<coderef>Mail::Cclient</coderef>". We haven't described a 
  general method of installation -- instead we explain how to set
  acmemail up starting from a fresh Red Hat Linux 6.1 box.
 </p>
 
 <p>
  If your setup isn't exactly a Red Hat 6.1 box then this may not quite
  work. We're in the process of automating this procedure, so this
  chapter will hopefully disappear some time soon. However, since
  everyone has a slightly different system and file layout, please
  read and understand this section -- sorry.
 </p>

 <p>
  This will get everything working. You may want to change some of
  the way we've done things. You may want database support, not POS.
  This isn't the most efficient way of installing either. Still, at
  the very least this should prove as a guide.

  In the following text '(yak yak yak)' means the computer responds
  with about a couple of hundred lines of useless of uninteresting
  code you can ignore...
 </p>

 <subsection name="Putting everything in the right place">

  <p>
   Download a copy of acmemail-2.2.2.tar.gz. From the directory acmemail
   is downloaded to do the following to extract the files and put them
   in the right place...
  </p>

  <code>
[mark@slave mark]$ su
Password:
[root@slave mark]# cp acmemail-2.2.2.tar.gz /home/httpd/cgi-bin/
[root@slave mark]# cd /home/httpd/cgi-bin/
[root@slave cgi-bin]# gunzip -c acmemail-2.2.2.tar.gz | tar -xf -
[root@slave cgi-bin]# rm -f acmemail-2.2.2.tar.gz
[root@slave cgi-bin]# mv acmemail-2.2.2 acme
[root@slave cgi-bin]# cd acme
[root@slave acme]# chown nobody.nobody dope mime-tmp
[root@slave acme]# mv mime-tmp ../../html
[root@slave acme]# mv graphics/ ../../html/acmegraphics</code>
 </subsection>

 <subsection name="Configuring acmemail">

 <p>
  Okay, now reconfigure acmemail to run correctly by editing <coderef>AcmemailConf.pm</coderef>
  using the text editor of your choice and alter the methods to do the
  following...
 </p>

 <code>
sub image_path() {
  return '/acmegraphics/';
}

sub smtphost() {
  return 'localhost';
}

sub local_domain() {
  return 'example.com';      # you need to change this to your own domain
}

sub session_type() {
  return "POS"; # using files and Persistant::Object::Simple
# return "Database"; # using a real database
}

# Where is the temporary mime directory?
sub temporary_mime_directory() {
  return "../../html/mime-tmp/";
}

# Where is the temporary mime directory? (in relation to the web server)
sub web_temporary_mime_directory() {
  return "/mime-tmp/";
}</code>

 <p>
  To save and exit in emacs do a Ctrl-X Ctrl-S Ctrl-X Ctrl-C -- but I should hope you know that already...
  Likewise it's Esc:qw for vi.
 </p>

 </subsection>

 <subsection name="Installing all the support modules">

  <p>
   While connected to the Internet do the following:
  </p>

  <code>
[root@slave acme]# perl -MCPAN -e shell;
  </code>

  <p>
   At this point if it's your first time running CPAN you'll need to
   answer a whole host of questions. On a Red Hat 6.1 box you can
   normally hit return for all questions but the ones on geography.
   Be sure to select follow.
  </p>

  <code>
cpan> install Bundle::CPAN</code>

  <p>
   This installs the latest version of CPAN, making your and my life
   easier, and also happens to install some of the modules that we
   want to install for acmemail anyhow.
  </p>

  <code>
cpan> exit
Lockfile removed.
[root@slave acme]# perl -MCPAN -e shell;

cpan> install CGI
(yak yak yak)
cpan> install HTML::Entities
(yak yak yak)
cpan> install Mail::Internet
(yak yak yak)
cpan> exit
Lockfile removed.</code>


  <p>
   Now we have to install <coderef>Mail::Cclient</coderef>.  This is not an easy task
   as it requires us to do this by hand, and we need to get the source
   distribution of the Washington imapd client (ow)... First we get the module.
  </p>

  <code>
[root@slave acme]# cd
[root@slave /root]# wget http://www.cpan.org/modules/by-module/Mail/Mail-Cclient-0.6.tar.gz
(yak yak yak)
[root@slave /root]# gunzip -c Mail-Cclient-0.6.tar.gz | tar -xf -</code>

  <p>
   Now get the (1.8MB) source distribution that this module relies on.
   This is probably on the Red Hat source distribution, but that's on
   th
e other side of the room at the moment, and I'm feeling lazy
  </p>

  <code>
[root@slave /root]# wget ftp.cac.washington.edu:/mail/imap-4.7b.tar.Z
[root@slave /root]# gunzip -c imap-4.7a.tar.Z | tar -xf -
[root@slave /root]# cd imap-4.7b
[root@slave imap-4.7b]# make slx
(yak yak yak)
[root@slave imap-4.7b]# cd ../Mail-Cclient-0.6
[root@slave Mail-Cclient-0.6]# perl Makefile.PL CCLIENT_DIR=../imap-4.7b/c-client/
(yak yak yak)
[root@slave Mail-Cclient-0.6]# make
(yak yak yak)
[root@slave Mail-Cclient-0.6]# make install
(yak yak yak)</code>

  <p>
   Note: If you get lots of "sv_undef undeclared" errors, add "POLLUTE=1" to the 
   "perl Makefile.PL..." command.
  </p>

  <p>
   Okay, that should have installed everything.  We'd better clear up
   after ourselves, but you might want to leave these installation
   files around till you're sure everything has worked, and come back
   and delete them at the end.
  </p>

  <code>
[root@slave Mail-Cclient-0.6]# cd
[root@slave /root]# rm -rf Mail-Cclient-0.6
[root@slave /root]# rm -rf imap-4.7b</code>

  <p>
Phew! Now back to CPAN
  </p>

  <code>
[root@slave /root]# perl -MCPAN -e shell;
cpan> install MIME::Entity
(yak yak yak)
cpan> install Persistence::Object::Simple
(yak yak yak)
cpan> install Time::CTime
(yak yak yak)
cpan> install URI::Escape
(yak yak yak)
cpan> install DBI
(yak yak yak)</code>
</subsection>

 <subsection name="Starting IMAP on your computer">
  <p>
   Your system probably isn't set up for IMAP, even if you did install
   the right RPMs at install time.  You'll need to edit your inetd
   file like so...
  </p>

  <code>
[root@slave acme]# emacs /etc/inetd.conf &amp;</code>

  <p>
   You're looking for the line which reads
  </p>

  <code>
#imap    stream  tcp     nowait  root    /usr/sbin/tcpd imapd</code>

  <p>
   Remove the hash (the '#') from the front, save and exit emacs, and
   then restart your server with this command :
  </p>

  <code>
root@slave init.d]# /etc/rc.d/init.d/inet restart
Stopping INET services:                                    [  OK  ]
Starting INET services:                                    [  OK  ]</code>

</subsection>

 <subsection name="The cron job">

  <p>
   In order to clear up after yourself you need to periodically clear
   house on the old and out of date files. To do this you need to
   add the following lines to <coderef>/etc/cron.daily/tmpwatch</coderef>:
  </p>

  <code>
/usr/sbin/tmpwatch 20 /home/httpd/html/mime-tmp
/usr/sbin/tmpwatch 20 /home/httpd/cgi-bin/acme/dope</code>

 </subsection>


 <subsection name="Testing everything">
  <p>
   Boot up your browser of choice and go to:

   <coderef>http://127.0.0.1/cgi-bin/acme/acmemail.cgi</coderef>

   And try thing out. Good luck.
  </p>


 <p>
  If all goes to plan you should see a login
  prompt. Try typing in your user name and password (you have set up a
  mail account on the server haven't you?) and you should display a
  list of messages in your inbox. If you don't have any messages then
  either:
 </p>

 <list>
  <item>get more friends</item>
  <item>wait until people send you some</item>
  <item>send yourself some</item>
 </list>

 <p>
  Then list the messages again. Now click on one of the subject lines
  and, hopefully, the message should be displayed. Try sending
  yourself some test messages, ones with an image, a binary file or a
  web page attached. Try multiple attachments. Try sending yourself a
  forwarded message. If all these work then you're definitely getting
  somewhere. Try replying, forwarding and just plain sending a
  message. Try attachments. Try life, Try a great big TV. Try
  apologizing for ripping off Trainspotting adverts.
 </p>

 <p>
  Annnnywaaaay. Back on the plot. 
 </p>

 </subsection>

 <subsection name="Additional web server restrictions">

 <p>
  There are quite a few temporary files in acmemail, and we would like
  to restrict direct viewing of these files / directories. In Apache
  this can be done by adding the following lines to the Apache
  configuration file (probably <coderef>httpd.conf</coderef>):
 </p>

 <code>
&lt;Directory /home/httpd/html/mime-tmp&gt;
  Options None    # no options means no indices/browsing
&lt;/Directory&gt;</code>

 </subsection>


 <subsection name="Setting up database sessions">

 <p>
  <emph>The following is completely optional. Only do this if you
  have lots of acmemail users.</emph>
 </p>

 <p>
  Above we've just set up acmemail to use POS (<coderef>Persistant::Object::Simple</coderef>)
  sessions. Unfortunately this doesn't scale very well, so if you want
  to have more than a couple of acmemail users, you should use a database
  to store the sessions.
 </p>

 <p>
  We're not going to explain how to configure or install a database --
  that's way outside the scope of this document. Acmemail current ships
  with scripts to set up the database tables for MySQL and PostgreSQL.
  Scripts for other databases will be similar.
 </p>

 <p>
  Note that for the following you'll need to have a username/password 
  which can create a database and tables. You may have to amend the scripts.
 </p>

 <p>
  With MySQL (given a username/password), something like the following should do:
 </p>

<code>
% mysqladmin create acmemail
Database "acmemail" created.
% mysql acmemail &lt; mysql.sql</code>

 <p>
  With PostgreSQL (given a username/password), something like the following should do:
 </p>

<code>
% su - postgres
[postgres@leonsplace pgsql]$ createdb acmemail
[postgres@leonsplace pgsql]$ psql acmemail &lt; postgresql.sql 
[postgres@leonsplace pgsql]$ exit</code>
  
 <p>
  Once that has been done, you have to change various parameters in <coderef>AcmemailConf.pm</coderef>. An
  example fragment showing the options that need to be changed:
 </p>

<code>
# What kind of sessions are we going to use?
sub session_type() {
# return "POS"; # using files and Persistant::Object::Simple
 return "Database"; # using a real database
}

# If using the Database session type...
# What is the datasource for our database?
sub db_datasource() {
  return "dbi:mysql:acmemail:localhost"; # for MySQL
#  return "dbi:Pg:dbname=acmemail"; # for PostgreSQL
}

# If using the Database session type...
# What is the username for access to the database
sub db_username() {
  return "acme";
}

# If using the Database session type...
# What is the password for access to the database
sub db_password() {
  return "thisisasecretpassword";
}</code>

 </subsection>
</section>


<section name="Common problems">

<p>
 Problem: You get weird errors about undefined values in <coderef>Database.pm</coderef>.
Solution: You haven't set up the database correctly, check it and try again.
</p>

<p>
 Problem: You keep getting "can't log in" messages.
Solution: check that you've set the right mail server and that you
          have actually got an account there and that you've typed 
          the username and password in properly.
</p>

<p>
 Problem: You get a web server error with something like "Can't locate Joe/Bloggs.pm in @INC".
Solution: This means you're missing the Joe::Bloggs module. Go find it
          on CPAN and install it.
</p>

<p>
 Problem: You're tired and can't think of any more 'common problems to write'.
Solution: Post documentation you've just written to mailing list and hope
          for the best (laziness, impatience and hubris etc. etc.)
</p>

<p>
 Problem: You get lots of "sv_undef undeclared" errors while installing
          Mail::Cclient.
Solution: Add "POLLUTE=1" to the "perl Makefile.PL..." command.
</p>

</section>


<section name="Security">

 <p>
  Security is very important aspect of a webmail program -- Hotmail,
  for example, has consistently had security problems in the past.
  Bugtraq (a security mailing list) notes that many webmail programs
  are vulnerable to trivial exploits.
  Acmemail attempts to be as secure as possible by default, although
  it will allow you to do unsecure things if it is more convenient
  for you.
 </p>

 <p>
  There are actually quite a few different aspects of security involved
  with a webmail program. I'll try and cover everything in as much depth
  as possible.
 </p>

 <subsection name="Server-side security">

  <p>
   Let's make this quite clear: the server side is the web server
   and the mail server that acmemail is running on or accessing -- these
   may even be the same machine. We need a username and password to
   connect to the mail server, so we store this as a session in either
   a POS file or a database.
  </p>

  <p>
   The risk here is that you may have users on the web server. If you
   are simply using POS sessions, the usernames and passwords are 
   visible to anyone in the DOPE directory. There are ways of 
   restricting this, but we much rather prefer database sessions --
   the database takes care of the security aspect for us.
  </p>

  <p>
   With database sesssions, the usernames and passwords are kept
   in the clear inside the database. Thus if the database is compromised,
   so will all your usernames and passwords. A solution for this is
   currently being investigated.
  </p>

  <p>
   Note that the installation instructions put the DOPE directory
   outside the web server root -- this is so that web users
   will not be able to access passwords.
  </p>

  <p>
   You should consider running acmemail on a secure server (SSL) --
   that way the username and password isn't sent over the
   network whenever a user logs on.
  </p>

  <p>
   Currently, emails are unpacked onto disk before being 
   displayed. You might consider this a problem if you have
   users on that machine. This is going to be replaced with
   decoding on the fly in the next major release.
  </p>

  <p>
   Ideally, the web server that acmemail is running on should
   be user-less. This solves many other problems.
  </p>

 </subsection>

 <subsection name="Client-side security">

  <p>
   The main problem with the client side of webmail programs
   is to never disclose the session ID. Classically, exploits
   achieve this by looking at the 'referer' field when a user
   clicks on a link or views a graphic embedded in a mail
   message.
  </p>

  <p>
   One way to reduce this threat is to not keep the session
   ID as a CGI parameter but instead as a cookie on the client 
   acmemail makes sure to only set cookies which
   do not have an expiration date -- this means the browser
   never saves them to disk. The cookie is expired when
   the user logs out. acmemail has a <coderef>force_cookies()</coderef> option
   to force people to use cookies in this way. This is
   enabled by default.
  </p>

  <p>
   There is the risk that JavaScript may be embedded into
   a mail message somehow -- the code would retrieve the
   session ID and then do something evil. Historically,
   it has been very tricky trying to filter away 
   Javascript, so acmemail goes the whole way and can
   force you to disable JavaScript completely with the
   <coderef>force_nojavascript()</coderef> option. This is enabled by
   default.
  </p>

  <p>
   However, forcing people to disable JavaScript is quite
   a strong option - your users will probably complain.
   It is for this reason that we have the <coderef>force_defang_html()</coderef>
   option. This will attempt to disable malicious HTML, although
   note that this may not be 100% effective. This is
   enabled by default.
  </p>

 </subsection>


</section>

<section name="Performance">

 <p>
  acmemail hasn't gone under a lot of performance testing, but it is
  sufficiently fast on normal hardware for small groups (say a couple
  hundred people in total). If you wish to scale beyond this, there are
  various things you should have a look at.
 </p>

 <subsection name="Basic acmemail">
  <p>
   Here we're going to talk about basic acmemail support under normal CGI.
   There are a number of performance limitations:
  </p>

   <list>
    <item>acmemail is running as plain CGI so for every single
          acmemail page view the web server has to read the
          script, start a Perl interpreter, and the interpreter has to compile
          to script into bytecode before actually interpreting the bytecode and
          doing anything. This can be slow.</item>
    <item>The use of <coderef>Persistant::Object::Simple</coderef> means that for every
          page view we're reading and writing to the disk. This can
          scale really badly</item>
    <item>If instead you're using a database to hold sessions, then every
          acmemail pageview starts and closes a brand new database connection.
          This can be quite slow with certain databases</item>
    <item>Whenever acmemail has to connect the IMAP/POP3 mail server (when it 
          reads a message list or an individual message), it starts
          the mail connection from scratch. This is known to be quite slow
          for some IMAP servers</item>
   </list>
 </subsection>

 <subsection name="Changing IMAP server">
  <p>
   IMAP is known to be significantly slower than POP3 so finding a 
   quick IMAP server is fairly important. The IMAP server bundled with 
   Red Hat 6.1 for example, is the 
   <link xml:link="simple" description="University of Washington IMAP server" href="http://www.washington.edu/imap/"/>.
   An alternative server which is known to be more scalable is the
   <link xml:link="simple" description="Cyrus IMAP server" href="http://asg.web.cmu.edu/cyrus/"/>.
   However, we haven't benchmarked these -- if you do, please let us know!
  </p>
 </subsection>

 <subsection name="mod_perl and Apache::DBI">
  <p>
   Luckily, there <emph>is</emph> something we can do if the web server
   acmemail is running under is Apache. There are various other ways of
   achieving this sort of speedup but it is much simpler to achieve under Apache.
   Switching to a faster web server (such as thttpd) will not approach the
   speedup the following supplies.
  </p>
 
  <p>
   <link xml:link="simple" description="mod_perl" href="http://perl.apache.org/"/>
   embeds a Perl interpreter into Apache server -- this avoids the overhead
   of starting an external interpreter and the penalty of Perl start-up time.
   It even caches the compiled Perl bytecode, giving us a great speedup.
   This alone should make acmemail from about two to ten times faster
   (but please do your own benchmarks and send them in!).
  </p>

  <p>
   In addition to mod_perl you'll also want <coderef>Apache::DBI</coderef>, a Perl module
   available on CPAN. This lets you have persistent database connections,
   thus saving you from any slow database connections. That is: the slow
   part in talking to a database is actually connecting to it (getting the
   database handle) -- once connected acmemail only does simple queries
   so these can be quite fast. <coderef>Apache::DBI</coderef> effectively has a pool of database handles
   and hands these out instead of connecting every time.
  </p>

  <p>
   Installing mod_perl is a bit challenging as it needs to be
   compiled in with the Apache server -- see the
   <link xml:link="simple" description="mod_perl developer guide" href="http://perl.apache.org/guide/install.html"/>
   for that. Installing <coderef>Apache::DBI</coderef> should be fairly easy -- it's just
   another CPAN module.
  </p>

  <p>
   Enabling mod_perl and <coderef>Apache::DBI</coderef> is done by simply adding the
   following to your Apache configuration file. Note that you should
   also change '<coderef>acmemail.cgi</coderef>' to '<coderef>acmemail.pl</coderef>'.
  </p>

  <code>
PerlModule Apache::DBI 
 
&lt;FilesMatch "\.pl$"&gt;
  SetHandler perl-script 
  PerlHandler Apache::Registry 
  Options ExecCGI 
  PerlSendHeader On 
&lt;/FilesMatch&gt;</code>  

  <p>
   Note: There is a major disadvantage to mod_perl -- your Apache processes
   will use up a great deal more memory. You should plan for this. Also 
   note that mod_perl is a complex program and that tuning Apache and mod_perl
   for optimum performance is a tricky thing to do, but at least this will 
   help!
  </p>

  <p>
   Summary: with a bit of work and some higher memory usage, acmemail 
   is able to scale much higher than its original limit.
   There still remains the problem of IMAP connections -- it's possible
   that connection pooling will be implemented in a future release.
  </p>
 
 </subsection>

</section>


<section name="How it all works">
 <p>
  Well, like any other CGI program acmemail is a state machine. Like a
  normal program CGI programs must store their state as GET or POST
  variables or in a persistent objects.
 </p>

 <p>
  This is in no way meant to be complete or totally accurate
  documentation of the internal workings of acmemail but it's a start
  if you want to start looking into the code.
 </p>

<subsection name="Login">
 <p>
  Displays the login box.
 </p>
</subsection>

<subsection name="List messages">
 <p>
  Lists messages in the mailbox you have selected. For POP3 this is
  always the INBOX but for IMAP that could be any of the mailboxes
  you're subscribed to.
 </p>

 <p>
  Each line gives information about a message; whether or not you've
  read this before, who it came from, whether or not it has an
  attachment, the time it was sent and gives you the option to delete
  it either individually or en masse.
 </p>

 <p>
  The subject line is a link to show the message and the name of the
  person who sent it is a link to compose a message to that person.
 </p>
</subsection>

<subsection name="Deletion">
 <p>
  Takes either an individual message or a list of messages, deletes
  them and then lists messages again.
 </p>
</subsection>

<subsection name="Show message">
 <p>
  Shows an individual message by recursively MIME decoding each
  section if there are any. If it's an image (such as a GIF) it saves
  it and decodes it, saves and then display it inline. Web pages are
  shown inline too which is rather sexy 'cos all the links are mangled
  properly to point to an absolute URL rather than relative ones.
 </p>

 <p>
  There are links to reply, reply to all and forward the message and
  the name of the sender and other people on the Cc list are turned
  into links to compose to that person.
 </p>
</subsection>

<subsection name="Compose">
 <p>
  Displays all the usual boxes plus one for attachments. Currently
  no-one can think of a decent way of doing multiple
  attachments. Bruno Daniels has produced a quick patch that just
  displays multiple attachment boxes. We'd prefer not to pass round
  file attachments as parameters (oooh, baaaaaad overheads) or storing
  the uploads as temporary files but... there's a pint for the first
  person to come up with something good. Time to look to see how other
  people do it.
 </p>
</subsection>

<subsection name="Reply, Reply to All and Forward">
 <p>
  Gets the message body, adds quote marks, sets the to or cc
  parameters and then calls compose.
 </p>
</subsection>

<subsection name="Send">
 <p>
  MIME encodes what it needs to encodes, sends the mail, and then
  displays your list of mails.
 </p>

 <p>
  Of course there are plenty of other auxiliary functions for mangling
  HTML links, recursively decoding MIME etc. etc.
 </p>

 <p>
  One of the big problems currently is that HTML formatting is done
  within lots of different functions which makes it a pain to change
  the layout and formatting. Hopefully this will change soon. Which
  leads us neatly onto ...
 </p>
</subsection>
</section>

<section name="The future: Project Sparkle">
 <p>
  The future is bright. The future is Sparkle. Ever since he got bored
  at work one day, had a couple of pints at lunchtime and got ideas
  above his station (grin) Mark Fowler has been working on a new
  development tree of acmemail called, for reasons known only to
  himself, "Project Sparkle". Basically acmemail suffers from its
  original purpose in that it was never designed to be a totally web
  based, fully-functional email client. Whilst it's been ripped to
  shreds and reinvented itself so many times even Madonna's taking
  notice, it's about time acmemail had a complete rewrite.
 </p>

 <p>
  The plan is to make it much more modular so that adding features
  will be easier rather than the current system of shoe-horning them
  into the existing structure. Things planned for this are:
 </p>

 <list>
  <item>An installer</item>
  <item>User level configuration</item>
  <item>Address books (probably using LDAP), including importing of
        Netscape, Outlook, and Pine addresses</item>
  <item>Easily redefinable look and feel (which would probably also lead to
        internationalisation and, gasp, themes, the goal of every Linux app,
        ('cos it can already send mail)). Themes should be available to
        make acmemail look like: Atdot, Hotmail, TWIG etc. etc.</item>
  <item>If display gets abstracted enough then maybe something like a GTK
        frontend</item>
  <item>Handling of PGP messages (signature verification at least)</item>
  <item>Multiple IMAP directories (moving mail between and subscribing to)</item>
  <item>Multiple attachments (if we ever figure out a decent way of doing it
        :/ )</item>
  <item>Handling of uuencoded files as attachments (possibly also MS tnef)</item>
  <item>Handling of multipart/related messages</item>
  <item>Displaying (and possibly showing) X-Face headers</item>
  <item>Judicious use of JavaScript if it's available but remains fully
        functional if it's not</item>
  <item>A spell checker for mail</item>
  <item>A function for showing full header display</item>
  <item>User-definable message filtering rules</item>
  <item>Optional outbox for sent messages</item>
  <item>A signature file capability</item>
  <item>Sortable message index (possibly threading)</item>
  <item>A pick list of recent addresses</item>
  <item>Possibly syslog error logging</item>
  <item>Entire message database search (eg IMAP search)</item>
  <item>Inline conversion of hard documents to a viewable format (eg MS Word)</item>
  <item>A printer-friendly viewing option</item>
  <item>The summary view should be customisable</item>
  <item>Default quotas (size of messages / attachments)</item>
  <item>Possibly option to export a folder or message in MBOX format</item>
  <item>Add administrator-definable extra message headers</item>
  <item>Add administrator-definable taglines on messages</item>
 </list>

 <p>
  One idea that has been knocking around is to do with MIME. Currently
  everything is decoded when you read a message and to download an
  non-inlinable attachment it has to get saved out as a temporary
  file. This is not ideal. A better arrangement would be that stuff
  only gets decoded when necessary and that stuff never has to get
  saved to disk. This cannot be done using the current MIME modules so
  either someone will have to write new ones or write patches for one
  of the current ones.
 </p>

 <p>
  Currently Project Sparkle is in a state of heavy development -- it
  only actually parses when it feels like it but as soon as it's a
  vaguely workable proposition it will become the new development
  tree. Mark assures me that that'll be 'really soon now'.
 </p>

 <p>
  acmemail is currently being used as the web based email client for a
  free, UK based ISP;
  <link xml:link="simple" description="ReedOn" href="http://www.reedon.net/"/>.
  For that
  it's been given a makeover by some professional (web) designers who
  are also going to give the release version a makeover (or two if, we
  get themes implemented).
 </p>

 <p>
  Basically, you think acmemail needs a feature, write it, send in a
  patch, Leon may or may not include it. Something broken?
  Ditto. Looking for ideas? Take a gander at the list above or check
  out the other web-based email clients listed below and steal / be inspired by their feature list.
 </p>

 <p>
  Coding not your idea of fun? Help with the documentation. Or try get
  it running on as many different systems and configurations as
  possible then tell us how you did it and how well it runs.
 </p>

 <p>
  If we ever get them implemented then write stuff for different
  languages or write different themes. The list goes on.
 </p>
</section>

<section name="The competition">

 <p>
  "We will fight them on the beaches, we will fight them on the sons of
  beaches" -- Miguel Churchill, Winston's bastard Mexican brother.
 </p>

 <p>
  Not really. We don't actually hate people who've written
  alternatives to acmemail so don't get any funny ideas about hunting
  them down like dogs. For those people who even considered it for the
  merest second, find a pony, stroke it and repeat after me "Free
  Software does not mean brutally slaying people who are writing apps
  similar to mine". Or something. Remember Open Source(tm) and
  competition are good things. Although try telling that to Microsoft.
 </p>

<subsection name="Arrowmail">
 <p>
  <link xml:link="simple" description="Arrowmail" href="http://www.webbasedemail.com/"/>
  first appeared looking suspiciously like acmemail, even down to the
  non-transparent GIFs. Now being sold for large quantities of money.
 </p>
</subsection>

<subsection name="AtDot">
 <p>
  <link xml:link="simple" description="AtDot" href="http://www.atdot.org/"/>
  seems quite spartan, but the new development release shows promise.
 </p>
</subsection>

<subsection name="IMHO">
 <p>
  <link xml:link="simple" description="IMHO" href="http://www.lysator.liu.se/~stewa/IMHO/"/>
  seems simple to install and lots of features. Written for the Roxen
  web server.
 </p>
</subsection>

<subsection name="IMP">
 <p>
  <link xml:link="simple" description="IMP" href="http://www.horde.org/imp/"/>
  seems quite popular. Written in PHP.
 </p>
</subsection>

<subsection name="TWIG">
 <p>
  <link xml:link="simple" description="TWIG" href="http://twig.screwdriver.net/"/>
  has turned into a groupware product. Very low bandwidth and
  simple. Written in PHP.
 </p>
</subsection>

<subsection name="WebMail">
 <p>
  <link xml:link="simple" description="WebMail" href="http://webmail.woanders.de/"/>
  seems quite cool. Written in Java.
 </p>
</subsection>

<subsection name="WING">
 <p>
  <link xml:link="simple" description="WING" href="http://users.ox.ac.uk/~mbeattie/wing/"/>
  seems very professional and scalable -- currently being used at Oxford
  with thousands of users. Functional. Written in Perl and for
  mod_perl.
 </p>
</subsection>

<subsection name="Some others">
 <p>
  Please insert names, URLs, and descriptions here. We need some more reviews,
  and it would be good if they were in depth too. Why should people choose
  acmemail over any of these?
 </p>
</subsection>

</section>

<section name="Licensing Terms">
 <p>
     acmemail is Copyright (c) 1997-2000 Leon Brocard. All rights reserved.
 </p>
 <p>
     You may distribute under the terms of either the GNU General
     Public License or the Artistic License, as specified in the
     Perl README file.
 </p>
</section>

<section name="Developers and contributors">
 <p>
  Leon Brocard wrote the original acmemail and maintains the code.
  Some of the developers live in the UK (Leon, Mark, Pete, Simon)
  while others are scattered around the globe. Development is
  carried out via a developer mailing list, so it doesn't really
  matter what timezone you're in!
 </p>

 <p>
  The full list of developers and contributors in alphabetical order follows --
  write in if you think you've been missed! Note that a couple people
  have pushed acmemail in the right direction but haven't actually
  written code. They are the unsung heroes. We salute them.
 </p>

 <list>
  <item>artz</item>
  <item>Pete Berlin</item>
  <item>Leon Brocard</item>
  <item>Rex Cooper</item>
  <item>Bruno Daniel</item>
  <item>Mark Fowler</item>
  <item>Luis Henrique Cassis Fagundes</item>
  <item>Duncan Hall</item>
  <item>John Hardin</item>
  <item>James Mastros</item>
  <item>ralph</item>
  <item>Peter W</item>
  <item>Simon Wistow</item>
 </list>
</section>

<section name="ChangeLog">
 <p>
  See the ChangeLog file distributed with acmemail.
 </p>
</section>

<section name="Authors">
 <p>
  This documentation was originally written by Simon Wistow. The new installation section
  was written by Mark Fowler. Leon Brocard has amended, reformatted, rephrased and added
  the security, and performance sections.
 </p>
</section>

</document>
