From owner-freebsd-isp Wed Feb 19 11:29:38 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id LAA13383 for isp-outgoing; Wed, 19 Feb 1997 11:29:38 -0800 (PST) Received: from absinthe.i3inc.com (Absinthe.stonos.washington.dc.us [206.27.237.33]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA13372 for ; Wed, 19 Feb 1997 11:29:30 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by absinthe.i3inc.com (8.7.2/8.7.2) with SMTP id OAA20877 for ; Wed, 19 Feb 1997 14:27:58 -0500 (EST) Message-Id: <199702191927.OAA20877@absinthe.i3inc.com> X-Authentication-Warning: absinthe.i3inc.com: Host localhost [127.0.0.1] didn't use HELO protocol To: isp@freebsd.org Subject: Re: Script to send mail to all users? In-Reply-To: Your message of "Wed, 19 Feb 1997 20:58:26 +0300 (MSK)" References: <199702191758.UAA12437@magrathea.chance.ru> X-Mailer: Mew version 1.03 on Emacs 19.34.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Date: Wed, 19 Feb 1997 14:27:58 -0500 From: Chris Shenton Sender: owner-isp@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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