Re: [approved] Function mapping messages to IDs?

2003-09-09 19:47:45


You do not specify if  you were processing MH-style folders are

Yes, I'm processing MH-style folders (maildir folders).

If the input  is from a MH-style folder,  mhonarc will actually
do a  numeric sort on  the directory contents first  to provide
some  parallel  to  filename numbers.   However,  if  MHPATTERN
resource is customized,  the order the files  are processed are
somewhat arbitrary.

I'm using

$ mhonarc -rcfile $file -mhpattern '^[^\.]' $maildir/{cur,new}

to generate the archive and the same command with -add to keep it
up to date.

Would it be  too hard to have MHonArc sort  the messages by their
date  (rather than  by their  filename) and  use that  order when
assigning them IDs?

BTW, MHonArc is  designed where the message  number really does
not  mean  much.   Why  is  the  message  numbering  assignment
important to you?

Because the URL given to each  message depends on the number.  If
the order is  somewhat arbitrary one could run  into trouble when
regenerating the archive from different sources as the URLs would
change and links from other locations would break.

I think it would be best to use some criteria that allows MHonArc
to  always  give  the  same  file  names  to  the  same  messages
regardless of whether  the archive is generated from a  MBox or a

This  criteria  should also  give  the  messages the  same  names
regardless  of whether  the archive  has been  constantly updated
using the ``-add'' argument or is  rebuilt from the ground up and
the only criteria  I can think of to make  this possible is using
the date (actually the date of arrival to the archive, hmm).

I recently  had to  rebuild my  HTML archive  (as I  changed some
options and also as I converted  my archive from Mbox to Maildir)
and I noticed that the URLs had changed.

Thank you very much for your help, Earl.


The mere formulation of a problem is far more essential than its solution.
      -- Albert Einstein.

$0='!/sfldbi!yjoV0msfQ!sfiupob!utvK'x44;print map{("\e[7m \e[0m",chr ord
"219CC1CCC033E7E660198CCE4E66798303873CCE60F3387$F"#Don't you love Perl?

Attachment: pgpT7S8IwJ_hR.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>