[Mailman-Users] How to to automatically add users..?
jonc at nc.rr.com
Sat Oct 19 19:36:56 CEST 2002
There are a lot of ways to do this...
You could dump out the passwd file via a cron job and a script that
skipped the first 29 or so users (system users) and then simply dumps
every other user to a file. Then you would use Mailman's command line
to sync that text file with a mailing list.
In the example below, I dump out the passwd file starting at the 30th
user and going to the end of the file. Then I add the domain part of
the email address (mydomain.com) for each user and pump that out to a
text file called localusers.txt. At that point I sync that file to a
local mailman list called "localusers".
USERS=`cat /etc/passwd |sed -n "30,$ p"| cut -f1 -d: `
for i in $USERS
echo $i at mydomain.com > ~mailman/localusers.txt
~mailman/bin/sync_members -f ~mailman/localusers.txt localusers
Here is the help description for sync_members:
Synchronize a mailing list's membership with a flat file.
This script is useful if you have a Mailman mailing list and a sendmail
:include: style list of addresses (also as is used in Majordomo). For
every address in the file that does not appear in the mailing list, the
address is added. For every address in the mailing list that does not
appear in the file, the address is removed. Other options control what
happens when an address is added or removed.
Good Luck - Jon Carnes
On Sat, 2002-10-19 at 06:57, Ciolo_-^DusT^-_WebMaster wrote:
> I'm the root of a server linux with a lot of users...
> I would like to have every user (also newusers) automatically added to the mailinglist.... how can I do this?
More information about the Mailman-Users