![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
Bernie Cosell wrote:
On 12 May 2009 at 17:58, Mark Sapiro wrote:
On Tue, May 12, 2009 at 08:27:45AM -0400, Bernie Cosell wrote:
Is there a command-line way to "discard all messags marked defer"?
Actually a FAQ more specific to this question is <http://wiki.list.org/x/nIA9>.
I've been pushing on this some, to no avail at the moment. The simple part was finding the data directory, the wiki isn't exactly correct: on our install, at least, the data directory is in /var/lib/mailman. Since it seems to be constructed from VAR_PREFIX I'd guess that on most setups it'd be in a different place than ~mailman.
I added a note to the FAQ about this.
What I'm running into now is that the command-line pgm has to be run as user 'mailman' and I can't do that [at least not very easily]. I tried setting discard to be setgid, but that seems not to work,
SETGID only works for binary executables. It doesn't work for scripts of any kind.
Can you add yourself to the 'mailman' group? That should be sufficient.
so I guess this is a followon question: is there a way to make python scripts run setuid/setgid? [basically, my situation is that I can only get to the mail server logged in as me, NOT logged in as mailman] -- I suppose I could always write a setgid Perl one-liner to run the Python discard..:o)
It won't work with Perl either. It has to be a binary executable. Thats the reason for all the compiled SETGID wrappers in mailman's cgi-bin/ and mail/ directories.
It seems you are able to get some kind of privileges on the mail server if you are able to make mailman files SETGID. Can you run sudo? Can you run newgrp to set your logged in group to 'mailman'?
The attached members.c.txt file is the source of a wrapper I use (the executable is SETGID mailman) to allow apache (php scripts) to execute certain mailman commands. If all else fails, you could strip the command check logic or add discard to the array of allowed commands and use it.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan