Messages saved in reverse order
Stephen Casner <[email protected]>
| Newsgroups | gmane.mail.pine.general |
|---|---|
| Message-ID | <[email protected]> |
Something bizarre has happened in Pine that I can't explain. I'm
running 4.64 on RH Linux with a local mailbox (inbox-path=INBOX) that
is in mail.txt (Tenex) format. My default sort order is arrival.
My mailbox has grown very large, so I decided that it was time to bite
the bullet and chop off the oldest messages into separate files per
month, which is the way I manage my mail. The first of these went
just fine: I selected messages before the cut-off date, and did apply
- save to a new file (written in traditional Unix format). Then I did
apply - delete on the saved messages, but no expunge yet. A quick
check of the new mail file in another instance of Pine looked correct.
So far so good.
Then I went to do the second month, selecting messages before one
month later, and unselecting those that were deleted. When I did
apply - save, the messages were written in reverse order. Selecting a
reverse sort first and then saving again still wrote the messages in
reverse order. I tried a number of variations, including expunging
the first month of deleted messages first, selecting by number range
rather than date, with and without a second instance of Pine running,
... Nothing helped.
So, I fetched the Pine sources and added debug prints to track what
was happening. I determined that the reason the messages are saved in
reverse order is that the loop in imap.c function imap_seq_exec()
iterates from the higher number to the lower number of a sequence such
as 1:10. Why?
I've hacked this code to go in increasing order, then I get the
desired result. But this must not be the whole story, because my
first month of messages came out right with stock Pine. My guess is
that some completely different path was used in that instance, and
that this imap function should probably not be used at all for a local
INBOX. The comment before the offending loop is "mark each item in
the sequence", so perhaps that code is only supposed to mark messages
for later processing, in which case the order in which they are marked
would not matter.
A corroborating bit of evidence for the theory of two different paths
is that the save operation for the first month of messages finished
very quickly, but for the second (when the messages were written in
reverse), the operation took much longer.
I'd welcome any guidance about what might be wrong with the
configuration or state of Pine or my mailbox such that I ran into this
problem. I've been using Pine for years without hitting this before.
-- Steve
_______________________________________________
Pine-info mailing list
[email protected]
http://mailman1.u.washington.edu/mailman/listinfo/pine-info