Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.*support@example.com.*
{}
: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?

share|improve this question
    
If there's an easier way to send a mailing list to all users in a system, please let me know. My Google searches are failing me. –  bradlis7 Mar 24 '10 at 16:34

1 Answer 1

up vote 0 down vote accepted

I think we're just going to use a program to do the mailing -- Simple Mailing List. Procmail is just too difficult.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.