0

I need to mail all users on my shared hosting platform. I need to be able to do this on a regular basis. Any thoughts?

1
  • Just all the local mail spools of all local users, or do they have external addresses you need to email? May 6, 2010 at 20:41

1 Answer 1

1

Maybe something like:

echo "message" | mailx -s "notify" `grep -v '#' /etc/passwd | cut -d : -f 1 | sed 's/\(.*\)/&@localhost/' | tr  '\n' ' '`

Mails message with subject notify to all local users in the system. You can add this to cron(1) and use different mail addresses from a file:

echo "message" | mailx -s "notify" `cat emaillist.txt`

You must log in to answer this question.