On 4/19/25 1:55 PM, Mihai Moldovan wrote:
This eventually led me to realize that passing
mailman.email.message.Message as the factory to mbox() internally calls
factory(msg), and the base class of Message (email.message.Message) has
an __init__ function that takes the policy parameter, so it looks as if
it's registering the mailbox message incorrectly as the policy handler,
which is totally wrong of course.
This appears to be a bug in mailbox.mbox. To work around it, try this:
```
from email import message_from_bytes
mb = mbox(sys.argv[2], create=False)
for key in mb.iterkeys():
msg = message_from_bytes(mb.get_bytes(key), Message)
```
and indeed, if I let the import actually happen, it works.
Still, it's probably better if the message is a
mailman.email.message.Message object rather than an
email.message.Message object.
The imported messages, do have a Message-ID-Hash, but the Archived-At
and List-Archive headers are empty (literally <>).
Those headers are added by the rfc_2369 handler based on the archivers
configured for the list. They will never point to the prototype archiver
or the message in the prototype archive.
Normally they will point to HyperKitty and to the archived message in
HyperKitty. This is the case even for messages in the prototype archiver
as those messages are just the message as delivered to the list members
absent any personalization.
Do you have an example message that was archived through Prototype? What
are the proper header values for this module? I believe that Archived-At
should be the Message-ID-Hash and the List-Archive header contain...
well, given that the Prototype archiver is not meant to be publicly
available, probably a file:// URL?
Typically they will be something like
List-Archive: <https://example.com/archives/list/listn...@example.com/>
Archived-At:
<https://example.com/archives/list/listn...@example.com/message/xxxxxx/>
where xxxxxx is the message-id hash value.
Note that the generation of these headers by the rfc_2369 handler
depends on this script being run in an installation that has hyperkitty
and mailman-hyperkitty installed and the hyperkitty archiver enabled for
the list.
--
Mark Sapiro <m...@msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
_______________________________________________
Mailman-users mailing list -- mailman-users@mailman3.org
To unsubscribe send an email to mailman-users-le...@mailman3.org
https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
Archived at:
https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/WR4NEPJC2ZQYTIGC65AFXVFTYI5NE5UV/
This message sent to arch...@mail-archive.com