Re: [Mailman-Users] Discarding defers from the command line

2009-05-16 Thread Bernie Cosell
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.

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, 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)

  /Bernie\

-- 
Bernie Cosell Fantasy Farm Fibers
mailto:ber...@fantasyfarm.com Pearisburg, VA
--  Too many people, too few sheep  --   



--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Users] Discarding defers from the command line

2009-05-16 Thread Mark Sapiro
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 m...@msapiro.netThe highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

#include stdio.h
#include stdlib.h
#include unistd.h

main(int argc, char** argv, char** env) {

char* legals[] = {
  list_members,
  find_member,
  invite_members,
  (char*) NULL
};

int i;
int flag = 0;
char command[100];

if (argc  2) {
dprintf(STDERR_FILENO,
Usage: %s command command_args\nNo command found\n,
argv[0]);
exit(1);
}

for ( i = 0; legals[i] != (char*) NULL; i++ ) {
if (strcmp(legals[i], argv[1]) == 0) {
flag = 1;
break;
}
}
if (!flag){
dprintf(STDERR_FILENO,
Usage: %s command command_args\nUnknown command: %s\n,
argv[0], argv[1]);
exit(1);
}
sprintf(command, /usr/local/mailman/bin/%s, argv[1]);
execve(command, argv[1], env);
dprintf(STDERR_FILENO, execve of %s failed\n, command);
exit(2);
}
--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9

Re: [Mailman-Users] Discarding defers from the command line

2009-05-16 Thread Brad Knowles

on 5/16/09 9:57 AM, Bernie Cosell said:

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.


Then you're using a version of Mailman that was provided as part of a 
binary package from some other source, and not our canonical source-only 
distribution of Mailman.


That's not necessarily a problem, but you do need to keep in mind that 
all our documentation and FAQs are written to the only standard we have, 
which is the original source code that we provide.  We can't control 
what anyone else does with whatever they provide, nor can we write their 
documentation for them.


--
Brad Knowles
b...@shub-internet.orgIf you like Jazz/RB guitar, check out
LinkedIn Profile: my friend bigsbytracks on YouTube at
http://tinyurl.com/y8kpxuhttp://preview.tinyurl.com/bigsbytracks
--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


[Mailman-Users] Discarding defers from the command line

2009-05-12 Thread Bernie Cosell
Is there a command-line way to discard all messags marked defer?
  /Bernie\

-- 
Bernie Cosell Fantasy Farm Fibers
mailto:ber...@fantasyfarm.com Pearisburg, VA
--  Too many people, too few sheep  --   



--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Users] Discarding defers from the command line

2009-05-12 Thread Adam McGreggor
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?

listadmin, perhaps?

q.v., http://wiki.list.org/x/aIA9

-- 
If all else fails, immortality can always
be assured by spectacular error.  (Galbraith)
--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Users] Discarding defers from the command line

2009-05-12 Thread Mark Sapiro
Adam McGreggor 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?

listadmin, perhaps?

q.v., http://wiki.list.org/x/aIA9


Actually a FAQ more specific to this question is
http://wiki.list.org/x/nIA9.

-- 
Mark Sapiro m...@msapiro.netThe highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9