Cleanup mailman held messages

Occasionally, you might encounter a situation where messages get held up in mailman for various reasons, and it’s essential to know how to clean up these held messages.

Cleaning Up with the Command Line:

The process of cleaning up held messages in Mailman is relatively straightforward, thanks to some handy command-line tools.

1. Navigating to the Mailman Directory:

First, open your terminal and navigate to the Mailman directory. You can usually find it at:

bash
$ cd /usr/lib/mailman

2. Using bin/discard:

To clean up held messages, you can typically use the bin/discard command. Run the following command, specifying the path to the held messages:

bash
$ bin/discard /var/lib/mailman/data/heldmsg--*

Cleaning Up a Long List of Held Messages:

In some cases, you might have a long list of held messages to deal with. In this situation, you can make use of a more efficient approach.

1. Navigating to the Appropriate Directory:

Navigate to the Mailman data directory where the held messages are stored. This is typically located at:

bash
$ cd /var/lib/mailman

2. Using find and xargs:

The find command helps you locate all the held messages. It searches for files with the name pattern “heldmsg–*”. After finding them, it passes them as arguments to the discard command using xargs.

Execute the following command:

bash
$ find data -name heldmsg--* -print | xargs /usr/bin/discard

This approach efficiently processes a long list of held messages and gets your Mailman mailing list back in order


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *