NAME
mhastart.pl - Help script for the MHonArc Email-to-HTML converter
DESCRIPTION
This script, written in Perl, provides some help when using MHonArc <http://www.mhonarc.org/>. It's particularly useful if you run MHonArc on a shared web server without shell access.
By means of mhastart.pl
you can invoke MHonArc from a browser, or let a mailing list archive be updated automatically.
The script presupposes that the raw email messages are stored in mbox format. It can be renamed to whatever you like, as long as the server understands that it is a CGI script that shall be executed. A number of configuration variables need to be set before running mhastart.pl
.
Control MHonArc from a browser
If you call mhastart.pl
from a browser, and after having entered a password, you end up at a page that allows you to execute MHonArc commands. If you just wish to add or remove messages, there are a couple of buttons that don't require all the arguments to be entered.
When adding messages, and if $pop3
is enabled, the script automatically grabs the messages (if any) from the POP account, and adds them to the mbox file, before MHonArc is invoked.
Automatic update
You can also pipe messages directly to mhastart.pl
, and let it update your mbox file and archive instantly each time a message arrives. Optionally, if the messages arrive on another server, you can pass them to this script through a HTTP request from a script on the other server.
If you collect messages from a mailing list on a POP account, you can instead update the archive by invoking this script via cron.
Refresh link
If you use a POP account, but do not let cron invoke the script automatically, you can place a link to mhastart.pl
on e.g. the main index page with the query string ?update
appended to the URL. When clicking the link, the script grabs messages from the POP account, adds them to the mbox file and the archive, and loads the updated main index page.
DEMO
A demo installation of mhastart.pl
is available at http://www.gunnar.cc/cgi-bin/mhonarc/mhastart.pl (password: demo
). Feel free to send a test message to demoarc at gunnar.cc
and add it to the archive.
EXAMPLES
Setting up a mailing list archive
This is how a basic MHonArc archiving of a mailing list can be set up by means of mhastart.pl
:
Upload the four MHonArc program files (
mhonarc
andmha-d*
) and thelib
directory to a directory designated for MHonArc, for instance/cgi-bin/mhonarc
(no editing of any MHonArc files is necessary).Upload a resource file to the MHonArc directory. It can be empty to start with.
Upload an empty file, for instance in a separate sub-directory to the MHonArc directory, in which the raw messages will be stored in mbox format.
Create a directory for the archive that is readable from the web.
Ensure that CGI scripts have write access to the archive directory and the mbox file.
Create a POP account, and subscribe the email address to that account to the mailing list.
Set the configuration variables in
mhastart.pl
, upload the script (in ASCII transfer mode), and make it executable (typically chmod 755).
That's basically it. Now, when new messages arrive to the POP account, you can easily add them to the mbox file and the archive.
To make use of MHonArc's extensive possibilities to customize the layout of your archive, you need to study the MHonArc documentation.
Forwarding
By forwarding incoming messages to mhastart.pl
, you can make them update the archive instantly. One way to do it is through a .forward
file as described at <http://www.mhonarc.org/MHonArc/doc/faq/archives.html#forward>, replacing webnewmail
with mhastart.pl
. If you don't have root access to the server, you will likely need to ask your web host to create the forward.
I'm maintaining a MHonArc archive on a server without email service. In that case, I'm forwarding incoming (to another server) email to a first script, which sends the messages to mhastart.pl
as HTTP requests. The supplementary script is available at <http://www.gunnar.cc/mhonarc/mailfwd.pl.txt>. Before sending a message, that script appends a password, and the subsequent password check prevents mhastart.pl
from updating the archive with arbitrary messages.
LATEST VERSION
The latest version of mhastart.pl
is available at: http://www.gunnar.cc/mhonarc/mhastart.pl.txt
QUESTIONS / BUGS
For questions or bug reports regarding this help script, please use the MHonArc Users mailing list: http://www.mhonarc.org/MHonArc/doc/contacts.html#mailinglist
AUTHOR
Copyright © 2002-2004 Gunnar Hjalmarsson
http://www.gunnar.cc/cgi-bin/contact.pl
This script is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the terms of the GNU GPL Licence <http://www.gnu.org/licenses/gpl.html>.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 259:
Non-ASCII character seen before =encoding in '©'. Assuming CP1252