Update of /cvsroot/mhonarc/mharc/bin
In directory subversions:/tmp/cvs-serv3998/bin
Modified Files:
extract-mesg-date filter-spool web-archive
Log Message:
* bin/extract-mesg-date:
. Added check for new MSG_DATE_FIELDS config.sh variable denoting
the message header fields to extract the date from. The
value of MSG_DATE_FIELDS is used if -datefields is not specified.
* bin/filter-spool:
. If there is no mail in the spool, but .newmail exists,
filter-spool will still process .newmail. .newmail is the
messages copied from the spool when filter-spool is executing.
In the past, even if .newmail exists, no mail in the spool
will cause filter-spool to exit.
* bin/web-archive:
. Added check for MSG_DATE_FIELDS config.sh variable. If set,
its value will passed to MHonArc via the DATEFIELDS resource.
. Define $MESG-CGI$ resource variable for use within MHonArc
resource files.
* cgi-bin/extract-mesg.cgi.in.dist:
. Internal changes so its uses new MHArc::CGI utility routines.
. POD added.
* cgi-bin/mesg.cgi.in.dist:
. NEW: New CGI program to extract a message from an archive based
upon message-id. This allows for persistent URLs to messages
that are immune to archive rebuilds that could change MHonArc
message numbers.
This CGI is referenced in the updated lib/common.mrc.in.dist
resource file via the $MESG-CGI$ resource variable. It is
used for the new [Bookmark Link] on message pages.
* cgi-bin/mnav.cgi.in.dist:
. Added some sanity checks to argument input.
. Internal changes so its uses new MHArc::CGI utility routines.
. POD added.
* lib/common.mrc.in.dist:
. Added "[Bookmark Link]" to message page layout to provide a
persistent link to the message. The link provided makes use
of the new mesg.cgi CGI script.
* lib/config.sh.dist:
. Added MSG_DATE_FIELDS: List of message header fields to extract
the date for a message.
. Added MESG_CGI: URL to persistent message reference CGI program
(mesg.cgi).
* lib/MHArc/CGI.pm:
. NEW: Shared CGI utility routines for mharc CGI scripts.
* lib/MHArc/MailUtil.pm:
. extract_date() routine changed to handle indexed header fields
in date fields argument.
CAUTION: Only use indexed field specification if you are using
a version of MHonArc *newer than* 2.5.11. MHonArc v2.5.11,
and earlier versions, do not support indexed fields for the
DATEFIELDS resource.
* lib/MHArc/Namazu.pm:
. NEW: Collection of routines related to Namazu.
Index: extract-mesg-date
===================================================================
RCS file: /cvsroot/mhonarc/mharc/bin/extract-mesg-date,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** extract-mesg-date 17 Jul 2002 21:59:36 -0000 1.1
--- extract-mesg-date 3 Sep 2002 16:30:47 -0000 1.2
***************
*** 76,81 ****
my @date_fields = ();
if (defined($opt_dfs)) {
! @date_fields = split(/:/, lc($opt_dfs));
}
my($fields, $header) = readmail::MAILread_file_header(\*STDIN);
print mhonarc::time2str(
--- 76,84 ----
my @date_fields = ();
if (defined($opt_dfs)) {
! @date_fields = split(/:/, $opt_dfs);
! } elsif (defined($config->{'MSG_DATE_FIELDS'})) {
! @date_fields = split(/:/, $config->{'MSG_DATE_FIELDS'});
}
+ print "date_fields=(_at_)date_fields\n" if $debug;
my($fields, $header) = readmail::MAILread_file_header(\*STDIN);
print mhonarc::time2str(
***************
*** 131,134 ****
--- 134,139 ----
Print out debugging information.
+
+ B<DO NOT USE THIS OPTION WITHIN PROCMAILRC RULES.>
=item C<-fmt> I<time-fmt-string>
Index: filter-spool
===================================================================
RCS file: /cvsroot/mhonarc/mharc/bin/filter-spool,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** filter-spool 23 Jul 2002 04:00:21 -0000 1.7
--- filter-spool 3 Sep 2002 16:30:47 -0000 1.8
***************
*** 113,119 ****
# Check that we have data to process
if ((! -e $mail) || ((stat($mail))[7] == 0)) {
! print qq/"$mail" does not exist or is zero bytes/ if $verbose;
! exit 1;
}
--- 113,124 ----
# Check that we have data to process
+ my $have_spool = 1;
if ((! -e $mail) || ((stat($mail))[7] == 0)) {
! $have_spool = 0;
! if (! -e '.newmail') {
! print qq/"$mail" does not exist or is zero bytes/ if $verbose;
! exit 1;
! }
! print qq/No new mail, but .newmail exists\n/;
}
***************
*** 125,141 ****
eval {
local @SIG{(_at_)_term_sigs} = (\&clean_lock) x scalar(@_term_sigs);
! if ($is_spool) {
! run_prg('lockfile', "-l$lock_to", '-ml');
! } else {
! run_prg('lockfile', "-l$lock_to", "$mail.lock");
! }
! if (cmd("/bin/cat '$mail' >>.newmail") == 0) {
! cmd("/bin/cat /dev/null >'$mail'");
! }
! if ($is_spool) {
! cmd('lockfile', '-mu');
! } else {
! unlink("$mail.lock") ||
! warn qq/Warning: Unable to remove "$mail.lock": $!\n/;
}
--- 130,148 ----
eval {
local @SIG{(_at_)_term_sigs} = (\&clean_lock) x scalar(@_term_sigs);
! if ($have_spool) {
! if ($is_spool) {
! run_prg('lockfile', "-l$lock_to", '-ml');
! } else {
! run_prg('lockfile', "-l$lock_to", "$mail.lock");
! }
! if (cmd("/bin/cat '$mail' >>.newmail") == 0) {
! cmd("/bin/cat /dev/null >'$mail'");
! }
! if ($is_spool) {
! cmd('lockfile', '-mu');
! } else {
! unlink("$mail.lock") ||
! warn qq/Warning: Unable to remove "$mail.lock": $!\n/;
! }
}
Index: web-archive
===================================================================
RCS file: /cvsroot/mhonarc/mharc/bin/web-archive,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** web-archive 26 Aug 2002 05:33:23 -0000 1.30
--- web-archive 3 Sep 2002 16:30:47 -0000 1.31
***************
*** 72,75 ****
--- 72,76 ----
'mknmzrc=s', # Pathname to Namazu configuration file.
'mknmztmpldir=s', # Pathname to Namazu template directory.
+ 'mesgcgi=s', # Message CGI URL.
'mnavcgi=s', # Month navigation CGI URL.
'mtimeage=i', # Modify time age of a mailbox file to be considered
***************
*** 142,145 ****
--- 143,149 ----
$config->{'ALL_LISTS_URL'} ||
$HTML_URL;
+ my $MESG_CGI = $opt{'mesgcgi'} ||
+ $config->{'MESG_CGI'} ||
+ join('/', $ROOT_URL,'cgi-bin/mesg.cgi');
my $MNAV_CGI = $opt{'mnavcgi'} ||
$config->{'MNAV_CGI'} ||
***************
*** 318,321 ****
--- 322,326 ----
'-definevar', "PNAV-CGI=$MNAV_CGI",
'-definevar', "EXTRACT-CGI=$EXTRACT_CGI",
+ '-definevar', "MESG-CGI=$MESG_CGI",
'-definevar', "ALL-LISTS-URL=$ALL_LISTS_URL",
***************
*** 341,344 ****
--- 346,352 ----
push(@mhaargs, '-editidx');
push(@mhaargs, '-nomsgpgs') if $editidxonly;
+ }
+ if (defined($config->{'MSG_DATE_FIELDS'})) {
+ push(@mhaargs, '-datefields', $config->{'DATE_FIELDS'});
}
if (!$debug && !$rebuild) {
---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV