From owner-freebsd-questions Thu Oct 12 17:03:06 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id RAA05256 for questions-outgoing; Thu, 12 Oct 1995 17:03:06 -0700 Received: from kryten.atinc.com (kryten.Atinc.COM [198.138.38.7]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id RAA05251 for ; Thu, 12 Oct 1995 17:03:01 -0700 Received: (jmb@localhost) by kryten.atinc.com (8.6.9/8.3) id TAA06940; Thu, 12 Oct 1995 19:50:40 -0400 Date: Thu, 12 Oct 1995 19:50:39 -0400 (EDT) From: "Jonathan M. Bresler" Subject: Re: Mailing Lists To: David Brockus cc: FreeBSD questions In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org Precedence: bulk On Thu, 12 Oct 1995, David Brockus wrote: > I am using FreeBSD 2.0.5. I was interested in setting up a way to have > someone email a single address, such as comments@cyberhall.com, then have > that original message distributed to the email addresses of people that I > haved defined. I was wondering if there is a way to send email to a group id > and have the members of that group id receive the letter. I was also > considering setting up a mailing list, but I am not certain what is involved > in configuring it. Could some please assist me? Thanks. to reach everyone on your system create a mail alias that includes everyone, dont bother with mailing list software. for an address list that has less to 20 people at other internet sites, use an alias again. otherwise consider using majordomo (madge says "you're soaking in it now"). FreeBSD.org uses majordomo for all its mailing lists. you can use this perl script to send mail to everyone on a particular host: #!/usr/bin/perl # # collect a mail message from STDIN # edit headers # send it out to everyone on this machine # # # set these to match your system # $debug = 0; $mailcmd = "/usr/bin/mail"; # # list all your non-user accounts here # %daemons = ( "root", 1, "toor", 1, "daemon", 1, "operator", 1, "bin", 1, "games", 1, "man", 1, "uucp", 1, "ingres", 1, "falcon", 1, "nobody", 1 ); # # collect the list of people # to receive the mail message # while ( $user = getpwent ) { (! $daemons{$user} ) && $targets .= " $user"; } # # collect the headers # junk lines that we dont need or want # while ( ) { last if ( /^$/o ); # end of headers next if ( /^Received: /o ); # remove these next if ( /^From /o ); # remove this line if ( ( $key, $value ) = ( /^(\S+):\s*(.*)/ ) ) { ; } $header{$key} = $value; } if ( $debug ) { open( OUT, "> /tmp/mailcatcher.$$") || die("$0 can't open output file"); foreach $key ( sort keys(%header) ) { print OUT "$key = $header{$key}\n" ; } } open( MAIL, "| /usr/bin/mail -s \"$header{'Subject'}\" jmb"); # # do the real work # while ( ) { $debug && print OUT; print MAIL; } Jonathan M. Bresler jmb@kryten.atinc.com | Analysis & Technology, Inc. FreeBSD Postmaster jmb@FreeBSD.Org | 2341 Jeff Davis Hwy play go. | Arlington, VA 22202 ride bike. hack FreeBSD.--ah the good life | 703-418-2800 x346