Mailman doesn’t have a command to re-inject all pending mails for the command line. Because in Debian Lenny the web-part is broken (wants to be recompiled because of wrong Apache group) I needed to re-inject a lot of mails which were pending.
Lets assume you already discarded spam and other non-allowed mails via the discard command and what is leftover are mails which are now accepted by mailman, because you added the sender to the allow-list.
First you will need a handy script from Marius Gedminas: mmextract.py.
Put this script in /usr/lib/mailman/bin/mmextract.py in case you need this more than once. Next, save the following script also to /usr/lib/mailman/bin: reinject_and_discard.sh.
reinject_and_discard.sh
#!/bin/bashfor i in `ls heldmsg-codetracker-*`; do
/usr/lib/mailman/bin/inject -l codetracker <(/usr/lib/mailman/bin/mmextract.py $i) /usr/lib/mailman/bin/discard $i done
This script will discard the mail after it has been injected.