to archive on a monthly basis i filter my mails in a .forward
file and then call a pl script. pls note our email is not
sendmail but exim (www.exim.org) so i dont know if sendmail
supports the same commands.
# .forward
#Exim filter
if error_message then finish endif
# Get todays month and year and pipe content off
if $tod_log matches "^(....-..)"
then
pipe "/path-to-scripts/Add2Exploder.pl ${local_part} ${1}"
endif
# Add2Archive.pl
#!/usr/local/bin/perl
# Script to create dated mhonarc forums for Eduserv Exploder
# Usage "cat message | AddArchive.pl <rcfile-prefix> <date>"
# e.g. "Add2Archive.pl niss 1999-12"
# Designed for use with exim and specifically to allow the creation
# of directories on the fly.
# Static Vars
my $docdir = '/path-to-htdocs/exploder';
my $confdir = '/path-to-config/exploder';
# Get Runtime Args
my $local_part = shift;
my $month = shift;
# Set output directory and the config file accordingly
my $outdir = "$docdir/$local_part/$month";
my $config = "$confdir/$local_part" . "-exploder.rc";
# Include MhOnarc code
require 'mhamain.pl';
# Create Date directory if it doesn't exist
unless ( -d "$outdir" )
mkdir "$outdir",0755 or die "$0: failed to create dir: $outdir: $!\n";
# Initialise Mhonarc
mhonarc::initialize();
# Process Message
mhonarc::process_input(
'-add',
'-quiet',
'-nodoc',
'-rcfile', "$config",
'-outdir', "$outdir",
);
Email Archive wrote:
>
> Hiya all,
>
> I am working on getting mhonarc setup. Anyone have any pretty
> rc files that i can use as examples? I also have the problem
> that I have been archiving email for months and months
> in one large file per email list. Does anyone know of a way
> to split up this file so mhonarc can process it on a month
> by month basis? How can I automate this month by month processing
> for the future? I would like to archive it as email comes in
> but once a month.. generate new web pages and link them to
> a main index page so users can just view a specific month
> of a mailing list.
>
> Thanks.. Mike
--
Andrew McGregor, EduServ (NISS), PO BOX 2674, BATH, BA2 7XY.
T: 01225 826 826 ext. 3419; F: 01225 826 177; E: [EMAIL PROTECTED]
e-mail to mobile < 140 chars: [EMAIL PROTECTED]