Converting e-mail to a web-accessible archive

Using MHonArc

Suppose you want to archive all e-mail in web-accessible form. You can do this on darkwing using a program called "mhonarc", one of several publicly available email-to-html converters.

First, create a directory under your public_html to hold the archive, e.g.

% mkdir public_html/archive

Then, modify your .forward or .procmail file to send messages through mhonarc for posting there. If your home directory is /home7/jqj, then a .forward file that saves all messages you receive in your regular inbox, plus stores them in the archive, is:

\jqj, "|/usr/local/bin/mhonarc -add -mbox -outdir $HOME/public_html/archive"

You of course need to replace the "jqj" with your own user name, and the "outdir" value with the appropriate Unix path pointing to your archive directory. Be careful of special characters -- "|" is vertical bar -- and make sure that the text appears all on one line.

In this example, an index of all messages received would be created in <http://darkwing.uoregon.edu/~jqj/archive/maillist.html>.

If you simply put the above line (including the quotation marks) in a .forward file in your home directory, then all e-mail to you on darkwing will be archived and publicly readable. Usually you'll want to archive only some mail, in which case you'll need to use the "procmail" program to select which mail to archive, based perhaps on the subject or sender of the message.

If you want to restrict web access to your e-mail archive, you can do so by creating a .htaccess file in the archive directory. Other darkwing users will still be able to see the archive, but you might use this, for instance, to limit access to on-campus only.

Extended example using procmail

Suppose I am subscribed to a majordomo list named "teachpast@lists" and want to archive all messages to that list. I first create a directory:

% mkdir public_html/teachpast-mail

Assuming I want the archive to be accessible only on-campus, I create a file public_html/teachpast-mail/.htaccess containing

<limit get>
order deny,allow
deny from all
allow from .uoregon.edu    
</limit>

Now I create a file in my home directory named .procmailrc containing instructions to forward some mail to mhonarc, and place the rest in my regular mailbox.

:0: mhonarc                # intercept mail to teachpast
* ^TO teachpast
|/usr/local/bin/mhonarc -add -mbox -outdir $HOME/public_html/teachpast-mail

This example is very short and fairly Draconian. All messages to teachpast are passed to mhonarc instead of being stored in my mailbox; all other messages get delivered to my inbox. If I wanted to get copies of the teachpast mail as well, I could replace the first line in this recipe with (the added "c" says "just generate a carbon copy for mhonarc):

:0 c: mhonarc    

I then create a .forward file containing:

"|IFS=' '&&exec /usr/local/bin/procmail -f-||exit 75 #$USER" 

And finally, I add a link from some other page to "teachpast archive", with a URL of <http://darkwing.uoregon.edu/~jqj/teachpast-mail/maillist.html>.

Pedagogical and privacy issues

E-mail, like any other original work, is copyright by the author of the work. You the recipient have only limited rights to copy, forward, or display other people's e-mail. In most large mailing lists, Internet custom includes an implied consent to archive and display the messages. However, for small or closed lists there may be no such implied consent to allow you to repost messages on the web! If you do want to do so, the best thing to do is to announce your intentions. If you're the list owner, you might include a specific note as part of the welcome message to the list that indicates that the archives for the list are publicly available. If you're the professor and the list is a class-wide mailing list, note in the syllabus your plans for the archive.

If it's a class mailing list, especially one where student posting is required, think twice before creating a public archive. Making the archive public may give your students a sense of empowerment -- they're publishing something for the whole world to see -- or it may stifle creative (and sometimes risky) contributions, and potentially invades your students privacy.

For further information


<http://darkwing.uoregon.edu/~jqj/publishing/mhonarc.html>, last update 7 Oct 97 by JQ Johnson