3 # This script reads a message from stdin, figures out which newsgroup's
4 # queue it should be saved to, and saves it.
7 # Figure out the home directory
10 if( !($0 =~ /\/scripts\/gatekeeper-file-message\.pl$/) ) {
11 die "This script can only be called with full path name!!!";
15 $webstump_home =~ s/\/scripts\/gatekeeper-file-message\.pl$//;
17 require "$webstump_home/config/webstump.cfg";
18 require "$webstump_home/scripts/webstump.lib.pl";
24 $newsgroup = @ARGV[0] || die "Syntax: $0 newsgroup.name";
26 $queue_dir = &getQueueDir( $newsgroup )
27 || die "Newsgroup $newsgroup is not listed in the newsgroups database";
29 mkdir $queue_dir, 0700; # it is OK if this fails
31 die "$queue_dir does not exist or is not writable"
32 if( ! -d $queue_dir || ! -w $queue_dir );
35 $file = "$queue_dir/$time.$$";
36 open( QUEUE_FILE, ">$file" ) || die "Could not open $file for writing";
39 print QUEUE_FILE or die $!;
42 close( QUEUE_FILE ) or die $!;