Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Feb 1997 14:27:58 -0500
From:      Chris Shenton <chris@absinthe.i3inc.com>
To:        isp@freebsd.org
Subject:   Re: Script to send mail to all users?
Message-ID:  <199702191927.OAA20877@absinthe.i3inc.com>
In-Reply-To: Your message of "Wed, 19 Feb 1997 20:58:26 %2B0300 (MSK)"
References:  <199702191758.UAA12437@magrathea.chance.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for the suggestions. Some iterated on the users, one message
per user; another cut the names and submitted that as part of the
command but I was concerned that the recipients would see all the
usernames and that the command line might be too long; a couple
suggested Qualcomm's pop bulletin board.

I finally went with a little program which used awk to create a file
with all users, then modifying /etc/aliases to use this. This avoids
users having to see thousands of names on the To: line, sending
multiple messages, and long command (or /etc/aliases) lines; it also
allows us to use whatever mail client to send the message, rather than
putting a message in a file.

It requires that you generate the new list of aliases to ensure the
list is current, but it's trivial. FYI, here's what I did:

/etc/aliases:

allusers:       :include:/etc/aliases.allusers


/usr/local/bin/makeallusers:

#!/bin/sh
# $Id: makeallusers,v 1.1 1997/02/19 19:20:56 chris Exp $
#
# Create a list of all (real) users, one per line, to be used as a
# mail alias via an :include: directive.
###############################################################################

cat /etc/passwd | awk -F':' '{print $1}' | egrep -v '^(root|toor|daemon|operator|bin|games|news|man|uucp|xten|nobody|ftp)$' > /etc/aliases.allusers





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702191927.OAA20877>