This sounds exactly like what I was looking for.  Thanks much !

Mike

-----Original Message-----
From:   Shawn McMahon [mailto:[EMAIL PROTECTED]]
Sent:   Thursday, June 11, 1998 9:26 AM
To:     [EMAIL PROTECTED]
Subject:        Re: Sendmail aliases

-----Original Message-----
From: Mike A. Lewis, CNE <[EMAIL PROTECTED]>
To: '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
Date: Thursday, June 11, 1998 4:13 AM
Subject: Sendmail aliases


>Is there a way to automatically create an entry in /etc/aliases for
>[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  whereby when a user
>is added to the system, the entry in /etc/aliases is automatically
>updated daily ?


First, copy this into a shell script called "createlist":

#!/bin/sh
awk -F: '{ print $1 }' /etc/passwd | grep -v P | grep -vxFf
/usr/local/bin/exclude | sort >/etc/allusers


Sorry for the broken line, those last two lines should be one line in
your
script.

The "grep -v P" is probably not necessary on your location, it
eliminates
accounts with a capital "P" in the userid from the list.
/usr/local/bin/exclude should contain the names of accounts you want
excluded from the list, one per line.  Any account in /etc/passwd that
you
don't want mail going to needs to be in this file.

Then, you add this to /etc/aliases:

[EMAIL PROTECTED]:       :include:/etc/allusers



Run newaliases after you add this.  Set up a cron job to run createlist
every day.

Run createlist manually any time you add a new account and want it to
receive mail immediately, or any time you delete an account and want it
to
stop receiving mail immediately.

Any mail sent to "[EMAIL PROTECTED]" will automagically go to
everybody in /etc/allusers.

If you don't want your users to know the magic alias, then send the
messages
to yourself, and bcc: them to the alias.

It is case-sensitive, so if you want to avoid the possibility of people
"trolling" for it, make it eVeRyOnE or something like that, or even
better
make it something like "djlfseiroosiofioei".  :-)

It won't do you much good, since I think /etc/aliases has to be
world-readable, but it'll keep outside folks from figuring it out.



-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST
ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips
/mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to