This seems like it should be fairly easy to do, but I've run into a few problems.
I've added a cron job to parse all users whose UID is greater than 500:
## This checks if the passwd file has been updated, and generates
## the .forward file from all users whose UID > 500, excluding nobody.
* * * * * root /usr/bin/test /etc/passwd -nt ~allusers/.forward \
&& /bin/egrep '([5-9]|[0-9]{2})[0-9]{3}' /etc/passwd | /bin/grep -v 65534 \
| /bin/cut -d ':' -f 1 > ~allusers/.forward
Then I created a .procmailrc file:
VERBOSE=yes
LOGFILE=/var/log/procmailrc
#Allow only certain users to send
:0
* ^From.*[email protected].*
{}
:0E
/dev/null
But, the .forward file is processed before it even gets to procmail, evidently. If I moved the .forward file to another filename, can I use it in procmail to send an email to the users in this file?
I think we're just going to use a program to do the mailing -- Simple Mailing List. Procmail is just too difficult.