<HTML>
<HEAD>
<TITLE>Re: [BlueOnyx:02924]  Oops - mail mayhem!</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Schoolboy error – just realised that my script also includes ‘allusers’ in it’s .forward – oops!<BR>
<BR>
Colin<BR>
<BR>
<BR>
<BR>
On 20/11/2009 20:16, "Colin Jack" <<a href="colin@mainline.co.uk">colin@mainline.co.uk</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I sometimes have to email all users on my BX servers and so created a script called ‘createforward.sh’ with the following:<BR>
 <BR>
ls -Al /home/sites/*/users/*/mbox | gawk {'print "\\"$9'} | sed 's~/mbox~~' | sed 's~/home/sites/.*/~~' > ~allusers/.forward<BR>
 <BR>
This creates a .forward file for the user ‘allusers’ with an entry for each user.<BR>
 <BR>
 I then email allusers@<hostname> and it forwards a copy to all the users. I then delete the .forward file.<BR>
 <BR>
It works BUT sends out xxx copies to each user where xxx is the total number of users on the box (i.e. in the .forward file) which is a bit embarrassing!<BR>
 <BR>
Can anybody suggest a better way of doing this?<BR>
 <BR>
Thanks<BR>
 <BR>
Colin<BR>
 <BR>
 <BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>