DEV Community

loading...

Mailman: How to update subject prefix number (post id)

Heddi Nabbisen
An ICT designer/developer and a security monk with "a cool brain and a warm heart". OpenBSD/Rust etc. Interested in social issues and relationships. Founder of Scqr Inc.
・1 min read

Summary

This post is about GNU Mailman and shows how to update the post id which appers in subject_prefix as prefix number.
It might be useful if you migrated Mailman servers using subject_prefix option.

* "Mailman" in this post means not Mailman3 but Mailman2, because I use OpenBSD.

Tutorial

Use withlist, "the most powerful and flexible script in Mailman", to manage the database.

# /usr/local/lib/mailman/bin/withlist $LIST_NAME
Loading list $LIST_NAME (unlocked)
The variable `m` is the $LIST_NAME MailList instance
Enter fullscreen mode Exit fullscreen mode

Lock the database files and update the post id.

>>> # check it
>>> m.post_id
current number

>>> # update
>>> m.Lock()
>>> m.post_id = 9999
>>> m.Save()

>>> # validate it
>>> m.post_id
updated number
Enter fullscreen mode Exit fullscreen mode

Quit the prompt.

>>> quit()
Unlocking (but not saving) list: $LIST_NAME
Finalizing
Enter fullscreen mode Exit fullscreen mode

Done :)

Discussion (0)