Scott Skrogstad wrote:
> 
> I would like to setup my mail server so that I could mail everyone on my
> service each month.  How do I accomplish this?

Qpopper has a feature called "bulletins". I've also seen several scripts
that will do what you need. Here's one:


#!/usr/bin/perl
#
# mailall: Sends STDIN as a mail message to all users.
#          The Subject line must be the first line of the message and
#          must be separated from the body by at least one blank line.

# Set some default values.
$script_version = '1.0';
$first_uid = 500;
$passwd = '< /etc/passwd';
$mailprog = '| /usr/sbin/sendmail -oi -t';

# Open the password file for input.
open(PASSWD,$passwd);

# Open a pipe to sendmail for output.
open(MAIL,$mailprog);

# Send the message headers.
print MAIL "From: \"System Administrator\" <root>\n";
print MAIL "To: \"All Users\" <root>\n";
print MAIL "X-Mailer: mailall $script_version\n";

# Put all the users in the Bcc header.
while($userline = <PASSWD>) {
   @userdata = split(/:/,$userline);
   $recipient_name = @userdata[0];
   $recipient_uid  = @userdata[2];
   if ($recipient_uid >= $first_uid) {
      print MAIL "Bcc: $recipient_name\n";
   }
}
close(PASSWD);

# Now send the message (including the Subject) as read from STDIN.
while ($line = <STDIN>) {
   print MAIL "$line";
}
close(MAIL);
exit;


-- 
 Anthony E. Greene <[EMAIL PROTECTED]>
 Homepage & PGP Key <http://www.pobox.com/~agreene/>
 Linux: The choice of a GNU Generation.


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to