[Mailman-Users] run add_members command in apache (php)

Harold Paulson haroldp at sierraweb.com
Tue Nov 26 19:53:23 CET 2002


Simon,

This is almost certainly a permissions problem.  See some of the 
posts I have made to the list in the past on this topic:

This tends to be very difficult.  The mailman scripts are run SGID so 
they can access files that are not readable by the rest of the web 
server, or other users on the system.  If you want a PHP script to be 
able to read the necessary files, you will have to change their 
permissions.  In particular, can do it by setting the config.db file 
o+r, or adding your mail server user to the mailman group.  This is a 
bad idea on a multi-user box though.  Check the archives for details 
on this.

here are a couple tips:

	1) At least during development, you will want to exec the mailman
	   scripts like: system("myprogram arg1 arg2 2>&1").  That way you will
	   see anything sent to STDERR

	2) all the CLI tools need to access mailman's config.db, which is 660
	   root.mailman.  So the owner of the web server process will at least
	   need to be added to the mailman group to read this.  It should be
	   noted that this is a gross security problem and would allow a
	   malicious user to of your system to do a lot of nasty things to
	   mailman and steal all  of the config info (like addresses that are
	   allowed to post to closed lists without approval).  You probably
	   don't want to do this on a  busy VHost machine.  The right thing to
	   do would be to write a little auth wrapper in Python that would
	   actually exec the tools, but I know fuck-all about Python, so I
	   haven't done that yet.

Good luck.

	- H


>Dear all,
>
>I just install mailman and want to add members directly in my own 
>web page and not use the mailman provided one. However, the command 
>/var/mailman/bin/add_members cannot be run in web page. I use php 
>function call
>
>system("/var/mailman/bin/add_members -d mailing-lists abc", $return_value)
>
>mailing-lists is the filename that stores the email address that 
>want to add into list.
>abc is the list name.
>
>I try to use apache user to run this command in console and it 
>works. But, cannot add members using this command in php.
>Anyone know how to solve it??
>
>Thanks.
>I use Redhat 7.3
>
>Regards
>
>Simon

-- 

Harold Paulson                  Sierra Web Design
haroldp at sierraweb.com           http://www.sierraweb.com
VOICE: 775.833.9500             FAX:   775-201-4458



More information about the Mailman-Users mailing list