Gnus development mailing list
 help / color / mirror / Atom feed
From: Brent Busby <brent@jfi.uchicago.edu>
To: ding@gnus.org
Subject: X-Gnus-Article-Number cleanup
Date: Tue, 26 Jan 2021 16:04:40 -0600	[thread overview]
Message-ID: <8xxr1m7iccn.fsf@jfi.uchicago.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 2370 bytes --]

I'm writing a small Perl script (which would probably be more apropos in
Lisp, but I'm not good at Lisp) to cleanup Berkeley mbox format
mailboxes for Gnus after they've been edited by other mailreaders like
Alpine and Mutt.  Sometimes I find this is necessary even when other
mailreaders haven't done anything to the mailbox, as when copying a
message into an nnfolder within Gnus that came from elsewhere in Gnus,
like copying a message from a Usenet newsgroup or a different nnfolder,
using the gnus-summary-move-article or gnus-summary-copy-article
commands (B m or B c).

The problem seems to be that if a message doesn't have the
X-Gnus-Article-Number header in a mailbox where all the preceeding
messages before it all _did_ have that header, the message that's
missing it and all messages after that will be invisible in Gnus.  This
also seems to happen if a message somehow gets a X-Gnus-Article-Number
that's out of sequence, lower in number than its preceeding messages in
the same mailbox.  The Xref header seems to be correlated here too.
Using 'B m' or 'B c' seems to have a very high likelyhood of messages
retaining their old metadata in the destination, and becoming invisible
in the destination folder because the old header contains data that's
now inapplicable or wrong in the new one.

I've been trying to figure out what to do to repair mailboxes like this
so Gnus will see all of them again.  Using sed to completely get rid of
all X-Gnus-Article-Number and/or Xref lines and then doing meta-g on the
group seems to work, but also seems a little brutal.  All of this makes
it very hazardous to move messages around between mailboxes, especially
if copying into an existing nnfolder, even within Gnus, with no
involvement from any other mailreaders.  It becomes necessary to do
header cleanup afterward to make all messages visible again.

What do you think would be the recommended way to hammer a mailbox's
Gnus metadata back into shape in situations like these?

-- 
+ Brent A. Busby	 + "We've all heard that a million monkeys
+ Sr. UNIX Systems Admin +  banging on a million typewriters will
+ University of Chicago	 +  eventually reproduce the entire works of
+ James Franck Institute +  Shakespeare.  Now, thanks to the Internet,
+ Materials Research Ctr +  we know this is not true." -Robert Wilensky

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]

             reply	other threads:[~2021-01-26 22:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 22:04 Brent Busby [this message]
2021-01-28  5:03 ` Lars Ingebrigtsen
2021-01-28 16:49   ` Brent Busby
2021-02-01  8:58     ` Lars Ingebrigtsen
2021-02-01 15:23       ` Brent Busby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8xxr1m7iccn.fsf@jfi.uchicago.edu \
    --to=brent@jfi.uchicago.edu \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).