#!/usr/bin/perl -W #FILE # $Id: procmailrc.pl 2 2005-11-13 01:37:02Z ggw $ # procmailrc.pl #PURPOSE # Creates a customized .procmailrc for the user logins (one per line) in a text # file. #LICENSE # GPL. # Original work by Nicolas Aimetti for unixservice.com 11/2003 # Derivative work done by Gary Wallis 12/2003 for distribution # with mysqlSendmail 1.2 #EXAMPLE # $procmailrc.pl newusers.txt #MODS # #NOTES # mysqlSendmail 1.2 will now generate all this stuff...all it needs is the # notifier.pl in the right place. # # So this file and HOWTO are "kinda" deprecated by 1.2 # use strict ; my $user; my $basedir = "/home/"; my $database = "/home/openisp/spam-system/isomsgsent.db"; my $logfile = "/home/openisp/spam-system/isomsgsent.log"; my $spam_message = "/home/openisp/spam-system/notifier.pl"; my $iso_server = "server2.isp.net"; #You should not have to change anything below this line if (@ARGV == 0 ){ die "usage: $0 \n"; } open(USERS,"<",$ARGV[0]) || die "Can't open file $ARGV[0]: $!\n"; while( $user = ){ chomp $user; open(FILE,">",$basedir.$user."/.procmailrc") || die localtime(). ": Can't open file ".$basedir.$user."/.procmailrc\n"; #Modify for your ISP: print FILE <> /var/mail/$user 2>> $logfile { :0 ! $user\@$iso_server } ENDL print $basedir.$user."/.procmailrc file was created\n"; close(FILE); }