[ale] limiting access to e-mail aliases
James L. Henrickson
jim at borg.com
Fri Dec 20 21:29:48 EST 1996
Juan Bou said:
>#! /bin/sh
>cd /var/spool/mail
>for i in *
>do
>mail -s "Aviso Importante" $i < /root/mensaje
>sleep 10
>done
>
>this script will send a copy of the file /root/mensaje to all the mailboxes
>names in /var/spool/mail, I needed to put the sleep 10 to send a message
>every 10 seconds to prevent overflow of the sendmail program, this will be
>different at your system, I use it to send a message to more than 1500
>users only writing the meesage I want to send in /root/mensaje, my system
>takes about 5 hours to generate the mail to every user and I usually start
>it at night
We do something similar, except that we put the subject line in the
body of the message. Then we invoke sendmail directly, setting the
delivery mode to "queue". That allows you to process the batch more
quickly, and tends to put less of a load on the mail server.
It is also a good idea to get your user list from someplace other than
/var/spool/mail. /etc/passwd is a good place, using awk (or something
similar) to strip off everything but the user names.
We send our messages from a separate server, which seems to lessen
the load on the mail server but I haven't bothered to verify it.
Some POP servers support broadcast messages, using a facility somewhat
like BSD's "mesg". Unfortunately, it needs hacking for systems that
don't have home directories. It, too, doesn't help for people that
forward their mail.
Jim Henrickson
Borg Internet Services
jim at borg.com
More information about the Ale
mailing list