I noticed that in the latest hypermail, the messages in an archive don't start with the same message number, depending on which option you use. Starting with a brand new archive:
hypermail -d dirname -u -m /path/to/mailbox
starts messages at number one (0001.html).
However if I invoke it as:
hypermail -d dirname -m /path/to/mailbox
starts messages with number zero (0000.html).
This is a big problem, because it breaks down the archives. For example, I'm using the -u option to to add new messages to the archive as they arrive to the mailing list, on the fly.
However, if I want to rebuild the archives and use the second option, all my messages will skip by one.
Source of the problem
It happens in hypermail.c:593:
/*
if (set_uselock)
lock_archive(set_dir);
if (set_increment) {
int num_displayable; if (set_linkquotes) replylist = NULL; num_displayable = loadoldheaders(set_dir); amount_old = max_msgnum + 1; /* counts gaps as messages */ /* start numbering at this number */ amount_new = num_displayable + parsemail(set_mbox,use_stdin, set_readone, set_increment, set_dir, set_inlinehtml, amount_old);
max_msgnum gets incremented when calling loadoldheaders. However, it's initial value is 0. So, when doing the:
mount_old = max_msgnum + 1; /* counts gaps as messages */
we automatically get one message skip if the archive was initially empty.. If we initialize max_msgnum to -1 before invoking loadoldheaders, then we don't have the skip anymore. And if there are any previous messages, max_msgnum gets updated correctly.
This problem doesn't happen when not using the -u option.
Proposed patches
if (set_increment) {
int num_displayable; if (set_linkquotes) replylist = NULL; max_msgnum = -1; ^^^ just initialize it before calling loadoldheaders.
2. Add a backwards compatibility option, so that people who need to rebuild their archives can precise if they want them to start with 1 or 0.
Something like:
start_num_is_0
And initialize max_msgnum accordingly (another patch is required when not using -u, to change max_msgnum accordingly. I tested it and it works ok too.)
Any comments?
In all cases, this is an awkward bug.
-jose Received on Thu 05 Jun 2003 03:59:26 PM GMT
This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:12 AM GMT GMT