Help Needed: How to send mail to "everybody" at once

Help Needed: How to send mail to "everybody" at once

Post by John Lind » Sat, 18 Jul 1992 07:42:34



Does anyone know how to send mail to everyone on a particular system
without having to specify all the user names?


P.S. I'm trying to save myself some time every time the system fills up.
     When it's full, I have to mail everybody to get them to clean up.

Thanks

 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Greg Bonn » Sun, 19 Jul 1992 00:37:08



>Does anyone know how to send mail to everyone on a particular system
>without having to specify all the user names?


>P.S. I'm trying to save myself some time every time the system fills up.
>     When it's full, I have to mail everybody to get them to clean up.

>Thanks

I suggest you get a book called "UNIX System Administration", by Nemeth, Snyder,
and Seebass, published by Prentice Hall.  This is the classic book that every
Unix Admin should have.  Among other things, it has a script called "spacegripe"
which you can call from your cron.  It looks for partitions that are getting
full, and automatically sends messages to disk-hogs.  Unfortunately, the real
problem arises when people choose to ignore these messages.  What can you do
then?

By the way, if you use NFS and NIS (formerly yp), you should also look into a
book called "Managing NFS and NIS" by Hal Stern, from O'Reilly & Associates,
Inc.

 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Greg Bonn » Sun, 19 Jul 1992 00:48:52



>I suggest you get a book called "UNIX System Administration", by Nemeth, Snyder,
>and Seebass, published by Prentice Hall.  This is the classic book that every

Correction to my previous post:
the book is called "UNIX System Administration Handbook".
 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Ken Konec » Sat, 18 Jul 1992 23:03:19



>Does anyone know how to send mail to everyone on a particular system
>without having to specify all the user names?

mail `awk -F: '{ print $1 }' /etc/passwd`

If you have cshell, this is a good candidate for an alias.

Cheers,
    -Ken K

--
Ken Konecki

"I just found out that the brain is like a computer.  If that's true,
then there really aren't any stupid people.  Just people running DOS."

 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Michael Alexand » Sun, 19 Jul 1992 10:19:07




>>Does anyone know how to send mail to everyone on a particular system
>>without having to specify all the user names?
>mail `awk -F: '{ print $1 }' /etc/passwd`

This lists all the receivers in the header, so a better way (among many)
to do this is to use a short script mailing to one destination at a time.

Cheers,

**************************************************************************
*  Michael F. Alexander               University of Southern California  *
*  --------------------               Ma-Bel-Network:    (215) 573-8379  *



**************************************************************************

 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Mark Garrett Internet: m.. » Mon, 20 Jul 1992 16:22:40



Quote:> Does anyone know how to send mail to everyone on a particular system
> without having to specify all the user names?

> P.S. I'm trying to save myself some time every time the system fills up.
>      When it's full, I have to mail everybody to get them to clean up.

If the systems full it's IMHO the last thing you want to be doing in
adding (mesg size * number of users) to the mail spool. How about doing a
real sysadmin thing and looking for the disk hog.

        "Find a better systems not a bigger hammer"

        Cheers
                Mark :)
--

   University of New England, Northern Rivers, Lismore NSW Australia.

 
 
 

Help Needed: How to send mail to "everybody" at once

Post by John F. Haugh » Mon, 20 Jul 1992 13:17:45



>Does anyone know how to send mail to everyone on a particular system
>without having to specify all the user names?


>P.S. I'm trying to save myself some time every time the system fills up.
>     When it's full, I have to mail everybody to get them to clean up.

You might want to try limiting your mailings to those users who are the
worst offenders.  I have always found that 90% of the disk space is used
by 10% of the users.  If you can get those people under control, the
problem will go away.
--
John F. Haugh II                   | Vida en La Republica de Tejas:
Ma Bell: (512) 251-2151            |  A Tejana woman, after spending the rent
UUCP: ...!cs.utexas.edu!rpp386!jfh |  money on the Tejas Lottery - "I can't go

 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Bill Tro » Thu, 23 Jul 1992 15:33:16



   >Does anyone know how to send mail to everyone on a particular system
   >without having to specify all the user names?

   mail `awk -F: '{ print $1 }' /etc/passwd`

   ...

I'm surprised no one has mentioned this:

On a system with 2000 users (yes, I have a particular one in mind  :-) ),
you will create deadly havoc with the machine if you try to send mail to
everyone.  Consider:

  * If your mail message small -- say, 1K, sending this message will
    consume two megabytes on your spool disk.  If you fill the spool disk,
    you essentially kill mail on the machine.

  * Given that you can't send mail to everyone at once (too many command
    line arguments), the next obvious approach is to send mail to each
    user personally.  Now, since all a program like mail does is pass the
    message of to sendmail, and sendmail runs as root (who is allowed an
    arbitrary number of processes), you suddenly create a sitation where
    the machine is trying to deliver hundreds of mail messages
    *simultaneously*.  This, more likely than not, will eventually crash
    the machine, and then the system administrator gets to play clean-up.

Conclusion?  Post news, or modify /etc/motd, or something -- but don't
send everyone mail.  You're bound to lose bad if you try.
--

Reed College Systems Manager  people into two types, and those who don't.

 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Andrew Philli » Thu, 23 Jul 1992 08:35:40



: >Does anyone know how to send mail to everyone on a particular system
: >without having to specify all the user names?
:
: mail `awk -F: '{ print $1 }' /etc/passwd`

To just send to normal users (which is I think what was asked)

mail `awk -F: '$3>199 && $3<10000 {print $1}' /etc/passwd`

(The specific numbers may vary on some systems but on ours normal
user numbers start at 200.)

 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Wes Morg » Fri, 24 Jul 1992 21:50:24



>Does anyone know how to send mail to everyone on a particular system
>without having to specify all the user names?

AAAAAAAAAUUUUUUUUUUGGGGGGGGGHHHHH!

John, this is one VERY EFFICIENT means of putting your personal fat in
the proverbial fire.   Mass mailings tend to put a significant strain
on most systems, for several reasons:

        1) The disk space allocated for mailboxes is shared among all
           users (on most Unix systems).  Sending messages to, say,
           1500 users will often fill up the "mailbox space"; as a
           result, NO ONE will receive any further mail until someone
           goes in and cleans it up.  The administrators break out the
           hangman's noose and start examining return addresses.

        2) Many mail programs spawn child processes to deliver mail.  A
           mailing to 1500 people might result in 1500 delivery processes
           running within seconds of each other.  The system slows to a
           crawl, and the administrators break out the hangman's noose and
           start examining return addresses.

        3) Many users go for months without checking their mailbox.  Your
           mass mailing might lie, unread, in the majority of mailboxes.
           The aforementioned "mailbox space" has less free space, and the
           administrators break out the hangman's noose.

If you REALLY think that EVERY user should see your message, ask your
admins to place it in /etc/motd or, if your system supports the news(1)
command, /usr/news.

Having just recovered from a mass mailing to 1800 users on one of my systems,
I can tell you that this is a Very Bad Thing (tm).

--




 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Charles H. Buchhol » Fri, 24 Jul 1992 22:33:59



> mail `awk -F: '{ print $1 }' /etc/passwd`

>To just send to normal users (which is I think what was asked)

>mail `awk -F: '$3>199 && $3<10000 {print $1}' /etc/passwd`

>(The specific numbers may vary on some systems but on ours normal
>user numbers start at 200.)

On my system (Sun 4/690, SunOS 4.1.2, wc -l /etc/passwd => 2500), this
will give "too many arguments".  Also, on my system this approach will
drive the load average through the roof and make the system unusably
slow.  Mail simply starts sendmail working on the message and returns
immediately, so you'll have hundreds (if not thousands) of sendmail
processes all competeing for the same system resources dumped onto
your system.

If you set "sendwait" before calling mail, mail will wait until
sendmail finishes before returning, so that you will only have one
sendmail process running at a time.

I remind my users that *news* is designed to send the same message to
many people - only one copy is saved per site, and minimal storing and
forwarding is done.  Mail is very inefficient when sending the same
message to many people, because each person gets their own copy,
separately stored and processed.

However, there are times when you realy do want to send the same
message as mail to many people.  In that situation, I use the
following script:

----------------------------------------------------------------------
#!/bin/sh
# usage:
#    bulkmail message list 'This is the Subject'
#
# "message" is the name of the file that contains the body of the
# message.
#
# "list" is the name of a file which contains the addresses, one per
# line
#
# The third argument is the subject.  The subject should be put in
# quotes so that it is all one argument.  You may have to escape some
# special characters.

if [ $# != 3 ]
then
    echo usage:  bulkmail message list \'This is the subject\'
    exit 1
fi

sendwait=true
export sendwait

while read address
do
    /usr/ucb/mail -s "$3" $address < $1
done < $2
----------------------------------------------------------------------


              School of Engineering and Applied Science
                      University of Pennsylvania

 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Marc S. Gibi » Sat, 25 Jul 1992 01:27:09


I have never actually had this need, but couldn't you just send to the
unix group(s) which has all users as its members?  Maybe this needs MH?

-Marc

 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Art Nicolays » Sat, 01 Aug 1992 14:28:48




>>Does anyone know how to send mail to everyone on a particular system
>>without having to specify all the user names?

>>P.S. I'm trying to save myself some time every time the system fills up.
>>     When it's full, I have to mail everybody to get them to clean up.
>I suggest you get a book called "UNIX System Administration", by Nemeth,
>Snyder, and Seebass, published by Prentice Hall.  

[..details about .. "spacegripe" shell script...]

Quote:>Unfortunately, the real problem arises when people choose to ignore
>these messages.  What can you do then?

I should point out that you can modify the output of the "spacegripe"
script to generate a "top 10 disk hogs" list that you can append to
/etc/motd.  This is one alternative Nemeth, et al discuss for getting
people to clean up their directories w/o the sysadmin having to send
them reminders over and over again.

My only objection to this script is that it is written with csh syntax
(eech!).  `

--

 
 
 

Help Needed: How to send mail to "everybody" at once

Post by Bob Cro » Sun, 02 Aug 1992 00:01:51


Here's how I did it:

1 -  I made sure that all of the non-people (you know, root, bin, uucp, etc...) user names appeared in
       the password file before the real people (fred, bobc, brent, etc...), and made the last non-user
        name that preceeds the first user name nobody.
2 -  I wrote the following shell and called it "/usr/lbin/mkmaillist":

        nobod=`grep -n nobody /etc/passwd | cut -d":" -f1`
        cut -d":" -f1 /etc/passwd | sed "1,$nobod d" | tr '\012' ' ' > /tmp/maillist

3 -  I then set up the following line in cron to run once a day:

           2 00 * * *  mailx -s "Maillist Make Done" root; /usr/lbin/mkmaillist

4 - Now whenever I need to send a mail message to every user on the machine, I just address it to
       /tmp/maillist like this:

       mail  `cat /tmp/maillist`
        {message text}
       .

        Everyone on the list gets the message!

Bob

--

Bob Croft

*** This not the opinion of Tandem Computers ***
*** Tandem Computers is not Tandon or Tandy  ***

 
 
 

1. Need Apache help, "server-parsed" with "send-as-is".

  Am using an Apache server, not directly under my control.
I can place "server-parsed" or "send-as-is" in my htaccess
file; but if I use both, "send-as-is" prevails and Apache
won't parse any SSI directives.
  Need a way to send a custom status code and content-type,
yet still use SSI. The htaccess file is my only control over
Apache. Is there any way to do this?

  Thank you.

2. WP6.0 License Daemon - Help Please

3. GETSERVBYNAME()????????????????????"""""""""""""

4. Disk Striping

5. URGENT HELP NEEDED: How do I stop mail being sent as "webmaster"?

6. Pipe benchmark wanted

7. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

8. Stereo include file /usr/include/linux/kd.h ? 8)

9. problems piping from "split" to "mail" (split | mail)

10. Sendmail: mails rejected with "550-unrouteable mail domain "blade150.lafr.de""

11. mail sends "you have mail messages" back to itself

12. Type "(", ")" and "{", "}" in X...

13. Need help making tape drive "Available" after "Defining"