#!/usr/bin/perl # # # 26-Dec-96 amo Mofified for my version for info@xxx # 19-Sep-00 amo Don't forget to set $homedir to your directory # 26-Mar-03 amo Added close LH # # # $Source: /sources/cvsrepos/majordomo/contrib/new-list,v $ # $Revision: 1.14 $ # $Date: 1996/12/09 16:50:45 $ # $Author: cwilson $ # $State: Exp $ # # $Locker: $ # set our path explicitly $ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb"; # Read and execute the .cf file $cf = $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf"; if ($ARGV[0] eq "-C") { $cf = $ARGV[1]; shift(@ARGV); shift(@ARGV); } if (! -r $cf) { die("$cf not readable; stopped"); } require "$cf"; chdir($homedir) || die("Can't chdir(\"$homedir\"): $!"); unshift(@INC, $homedir); require "majordomo.pl"; require "shlock.pl"; &ParseMailHeader(STDIN, *hdrs); $reply_to = &RetMailAddr(*hdrs); $reply_to = join(", ", &ParseAddrs($reply_to)); die("new-list: $reply_to is not a valid return address.\n") if (! &valid_addr($reply_to)); $in_reply_to = $hdrs{"message-id"} . ", from " . $hdrs{"from"}; # # # 26-Dec-96 My version to handle virtual domains # # $list = $ARGV[0]; $list = $ARGV[0]; # info@xxx $Lst = $ARGV[1]; # 15-Dec-96 the File to send # ---------------------------------------------------------------------------------- # # remember who asked for automated emails...check permissions of the Log.info file # --------------------------------------- # planet:/usr/test/majordomo-1.94# la Log.info # -rw-rw---- 1 majordom daemon 51 Dec 17 03:14 Log.info # # # For time-stamping the log file # require "ctime.pl"; chop ( $ts = &ctime ( time ) ); # #info = "$home/usr/local/majordomo/Log.info"; $info = "$homedir/Log.info"; # open ( LH, ">> $info" ) || die "new-list: ERROR: Could not open $info..\n"; # # append the current data to the log file print LH "$ts $list\@$whereami $reply_to\n"; # # 26-Mar-03 amo Added close LH close ( LH ) ; # # # -------------------------------------------- # Define all of the mailer properties: # It is possible that one or both of $sendmail_command and $bounce_mailer # are not defined, so we provide reasonable defaults. $sendmail_command = "/usr/lib/sendmail" unless defined $sendmail_command; $bounce_mailer = "$sendmail_command -f\$sender -t" unless defined $bounce_mailer; $sender = "$list-approval"; $mailcmd = eval qq/"$bounce_mailer"/; # # from majordomo-1.93 # open(MAIL, "|-") || &do_exec_sendmail(split(' ', "/usr/lib/sendmail -f$list-approval -t")); # # 26-Dec-96 amo take these out and use the above # # if (defined($isParent = open(MAIL, "|-"))) { # &do_exec_sendmail(split(' ', $mailcmd)) # unless $isParent; # } else { # &abort("Failed to fork prior to mailer exec"); # } # # # 26-Dec-96 amo don't send this generic stuff....send "real info"... # # print MAIL <<"EOM"; # To: $reply_to # Cc: $list-approval # From: $list-approval # Subject: Your mail to $list\@$whereami # In-Reply-To: $in_reply_to # Reply-To: $list-approval\@$whereami # # This pre-recorded message is being sent in response to your recent # email to $list\@$whereami. # # If you were trying to subscribe to the list, please send your request # to $whoami, not to $list\@$whereami. # # This is a new list. Your message is being returned unsent, but please # hold on to it. After a few days, when the flood of subscription # requests has died down somewhat, the owner of the list will announce # that the list is "open for business"; you should resubmit your posting # then. This way, everybody who joins the list within the first few days # of its existence starts out on an even footing, and we don't end up # with every other message asking "what did I miss?". # # Here's your original, unsent message: # # EOM # ; # ------------------------------------------------------------ # ------------------------------------------------ # # 26-Dec-96 amo Send these *.info messages based on virtual domains # print MAIL <<"EOM"; To: $reply_to Cc: $list-approval From: $list-approval Subject: Automated Response From $list\@$whereami In-Reply-To: $in_reply_to Reply-To: $list-approval\@$whereami EOM # # Attach my automated response # ---------------------------- # #file = "/usr/local/majordomo/$Lst"; $file = "$homedir/$Lst"; open ( FH, "< $file" ) || die "new-list: ERROR: Could not open $file..\n"; while ( ) { print MAIL $_; } close ( FH ); # --------------------------------------------------- # print MAIL "\nHere's your original message:\n\n"; # # foreach ("From", "To", "Cc", "Subject", "Date", "Message-ID") { ($hdr = $_) =~ tr/A-Z/a-z/; if (defined($hdrs{$hdr})) { print MAIL "> $_", ": ", $hdrs{$hdr}, "\n"; } } print MAIL "\n"; while () { print MAIL "> $_"; } close(MAIL); exit 0; # # end of file