3 # yapfaq Version 0.8 by Thomas Hochstein
4 # (Original author: Marc Brockschmidt)
6 # This script posts any project described in its config-file. Most people
7 # will use it in combination with cron(8).
9 # Copyright (C) 2003 Marc Brockschmidt <marc@marcbrockschmidt.de>
10 # Copyright (c) 2010 Thomas Hochstein <thh@inter.net>
12 # It can be redistributed and/or modified under the same terms under
13 # which Perl itself is published.
17 # Please do not change this setting!
18 # You may override the default .rc file (.yapfaqrc) by using "-c .rc file"
19 my $RCFile = '.yapfaqrc';
20 # Valid configuration variables for use in a .rc file
21 my @ValidConfVars = ('NNTPServer','NNTPUser','NNTPPass','Sender','ConfigFile','Program');
23 ################################### Defaults ###################################
24 # Please do not change anything in here!
25 # Use a runtime configuration file (.yapfaqrc by default) to override defaults.
26 my %Config = (NNTPServer => "",
30 ConfigFile => "yapfaq.cfg",
33 ################################# Main program #################################
37 use Net::Domain qw(hostfqdn);
38 use Date::Calc qw(Add_Delta_YM Add_Delta_Days Delta_Days Today);
39 use Fcntl ':flock'; # import LOCK_* constants
41 $Getopt::Std::STANDARD_HELP_VERSION = 1;
42 my ($TDY, $TDM, $TDD) = Today(); #TD: Today's date
44 # read commandline options
46 getopts('Vhvpdt:f:c:s:', \%Options);
47 # -V: print version / copyright information
49 print "$0 v $VERSION\nCopyright (c) 2003 Marc Brockschmidt <marc\@marcbrockschmidt.de>\nCopyright (c) 2010 Thomas Hochstein <thh\@inter.net>\n";
50 print "This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.\n";
53 # -h: feed myself to perldoc
59 my ($Faq) = $Options{'f'} if ($Options{'f'});
61 # read runtime configuration (configuration variables)
62 $RCFile = $Options{'c'} if ($Options{'c'});
64 readrc (\$RCFile,\%Config);
66 warn "$0: W: .rc file $RCFile does not exist!\n";
69 $Options{'s'} = $Config{'Program'} if (!defined($Options{'s'}));
71 # read configuration (configured FAQs)
73 readconfig (\$Config{'ConfigFile'}, \@Config, \$Faq);
76 # - parse configuration
78 # - if FAQ is due: call postfaq()
80 my ($LPD,$LPM,$LPY) = (01, 01, 0001); #LP: Last posting-date
81 my ($NPY,$NPM,$NPD); #NP: Next posting-date
84 my ($ActName,$File,$PFreq,$Expire) =($$_{'name'},$$_{'file'},$$_{'posting-frequency'},$$_{'expires'});
85 my ($From,$Subject,$NG,$Fup2)=($$_{'from'},$$_{'subject'},$$_{'ngs'},$$_{'fup2'});
86 my ($MIDF,$ReplyTo,$ExtHea)=($$_{'mid-format'},$$_{'reply-to'},$$_{'extraheader'});
87 my ($Supersede) =($$_{'supersede'});
89 # -f: loop if not FAQ to post
90 next if (defined($Faq) && $ActName ne $Faq);
93 if (open (FH, "<$File.cfg")) {
95 if (/##;; Lastpost:\s*(\d{1,2})\.(\d{1,2})\.(\d{2}(\d{2})?)/){
96 ($LPD, $LPM, $LPY) = ($1, $2, $3);
97 } elsif (/^##;;\s*LastMID:\s*(<\S+@\S+>)\s*$/) {
103 warn "$0: W: Couldn't open $File.cfg: $!\n";
106 $SupersedeMID = "" unless $Supersede;
108 ($NPY,$NPM,$NPD) = calcdelta ($LPY,$LPM,$LPD,$PFreq);
110 # if FAQ is due: get it out
111 if (Delta_Days($NPY,$NPM,$NPD,$TDY,$TDM,$TDD) >= 0 or ($Options{'p'})) {
113 print "$ActName: Would be posted now (but running in simulation mode [$0 -d]).\n" if $Options{'v'};
115 postfaq(\$ActName,\$File,\$From,\$Subject,\$NG,\$Fup2,\$MIDF,\$ExtHea,\$Config{'Sender'},\$TDY,\$TDM,\$TDD,\$ReplyTo,\$SupersedeMID,\$Expire);
117 } elsif($Options{'v'}) {
118 print "$ActName: Nothing to do.\n";
124 #################################### readrc ####################################
125 # Takes a filename and the reference to an array which contains the valid options
128 my ($File, $Config) = @_;
130 print "Reading $$File.\n" if($Options{'v'});
132 open FH, "<$$File" or die "$0: Can't open $$File: $!";
134 if (/^\s*(\S+)\s*=\s*'?(.*?)'?\s*(#.*$|$)/) {
135 if (grep(/$1/,@ValidConfVars)) {
136 $$Config{$1} = $2 if $2 ne '';
138 warn "$0: W: $1 is not a valid configuration variable (reading from $$File)\n";
144 ################################## readconfig ##################################
145 # Takes a filename, a reference to an array, which will hold hashes with
146 # the data from $File, and - optionally - the name of the (single) FAQ to post
149 my ($File, $Config, $Faq) = @_;
150 my ($LastEntry, $Error, $i) = ('','',0);
152 print "Reading configuration from $$File.\n" if($Options{'v'});
154 open FH, "<$$File" or die "$0: E: Can't open $$File: $!";
156 next if (defined($$Faq) && !/^\s*=====\s*$/ && defined($$Config[$i]{'name'}) && $$Config[$i]{'name'} ne $$Faq );
157 if (/^(\s*(\S+)\s*=\s*'?(.*?)'?\s*(#.*$|$)|^(.*?)'?\s*(#.*$|$))/ && not /^\s*$/) {
158 $LastEntry = lc($2) if $2;
159 $$Config[$i]{$LastEntry} .= $3 if $3;
160 $$Config[$i]{$LastEntry} .= "\n$5" if $5 && $5;
162 if (/^\s*=====\s*$/) {
170 next if (defined($$Faq) && defined($$Config[$i]{'name'}) && $$Config[$i]{'name'} ne $$Faq );
171 unless(defined($$Config[$i]{'name'}) && $$Config[$i]{'name'} =~ /^\S+$/) {
172 $Error .= "E: The name of your project \"$$Config[$i]{'name'}\" is not defined or contains whitespaces.\n"
174 unless(defined($$Config[$i]{'file'}) && -f $$Config[$i]{'file'}) {
175 $Error .= "E: The file to post for your project \"$$Config[$i]{'name'}\" is not defined or does not exist.\n"
177 unless(defined($$Config[$i]{'from'}) && $$Config[$i]{'from'} =~ /\S+\@(\S+\.)?\S{2,}\.\S{2,}/) {
178 $Error .= "E: The From header for your project \"$$Config[$i]{'name'}\" seems to be incorrect.\n"
180 unless(defined($$Config[$i]{'ngs'}) && $$Config[$i]{'ngs'} =~ /^\S+$/) {
181 $Error .= "E: The Newsgroups header for your project \"$$Config[$i]{'name'}\" is not defined or contains whitespaces.\n"
183 unless(defined($$Config[$i]{'subject'})) {
184 $Error .= "E: The Subject header for your project \"$$Config[$i]{'name'}\" is not defined.\n"
186 unless(!$$Config[$i]{'fup2'} || $$Config[$i]{'fup2'} =~ /^\S+$/) {
187 $Error .= "E: The Followup-To header for your project \"$$Config[$i]{'name'}\" contains whitespaces.\n"
189 unless(defined($$Config[$i]{'posting-frequency'}) && $$Config[$i]{'posting-frequency'} =~ /^\s*\d+\s*[dwmy]\s*$/) {
190 $Error .= "E: The Posting-frequency for your project \"$$Config[$i]{'name'}\" is invalid.\n"
192 unless(!$$Config[$i]{'expires'} || $$Config[$i]{'expires'} =~ /^\s*\d+\s*[dwmy]\s*$/) {
193 warn "$0: W: The Expires for your project \"$$Config[$i]{'name'}\" is invalid - set to 3 month.\n";
194 $$Config[$i]{'expires'} = '3m'; # set default (3 month) if expires is unset or invalid
196 unless(!$$Config[$i]{'mid-format'} || $$Config[$i]{'mid-format'} =~ /^<\S+\@(\S+\.)?\S{2,}\.\S{2,}>/) {
197 warn "$0: W: The Message-ID format for your project \"$$Config[$i]{'name'}\" seems to be invalid - set to default.\n";
198 $$Config[$i]{'mid-format'} = '<%n-%d.%m.%y@'.hostfqdn.'>'; # set default if mid-format is invalid
201 $Error .= "-" x 25 . 'program terminated' . "-" x 25 . "\n" if $Error;
202 die $Error if $Error;
205 ################################# calcdelta #################################
206 # Takes a date (year, month and day) and a time period (1d, 1w, 1m, 1y, ...)
207 # and adds the latter to the former
210 my ($Year, $Month, $Day, $Period) = @_;
211 my ($NYear, $NMonth, $NDay);
213 if ($Period =~ /(\d+)\s*([dw])/) { # Is counted in days or weeks: Use Add_Delta_Days.
214 ($NYear, $NMonth, $NDay) = Add_Delta_Days($Year, $Month, $Day, (($2 eq "w")?$1 * 7: $1 * 1));
215 } elsif ($Period =~ /(\d+)\s*([my])/) { #Is counted in months or years: Use Add_Delta_YM
216 ($NYear, $NMonth, $NDay) = Add_Delta_YM($Year, $Month, $Day, (($2 eq "m")?(0,$1):($1,0)));
218 return ($NYear, $NMonth, $NDay);
221 ################################ updatestatus ###############################
222 # Takes a MID and a status file name
223 # and writes status information to disk
226 my ($ActName, $File, $date, $MID) = @_;
228 print "$$ActName: Save status information.\n" if($Options{'v'});
230 open (FH, ">$$File.cfg") or die "$0: E: Can't open $$File.cfg: $!";
231 print FH "##;; Lastpost: $date\n";
232 print FH "##;; LastMID: $MID\n";
236 ################################## postfaq ##################################
237 # Takes a filename and many other vars.
239 # It reads the data-file $File and then posts the article.
242 my ($ActName,$File,$From,$Subject,$NG,$Fup2,$MIDF,$ExtraHeaders,$Sender,$TDY,$TDM,$TDD,$ReplyTo,$Supersedes,$Expire) = @_;
243 my (@Header,@Body,$MID,$InRealBody,$LastModified);
245 print "$$ActName: Preparing to post.\n" if($Options{'v'});
248 $$TDM = ($$TDM < 10 && $$TDM !~ /^0/) ? "0" . $$TDM : $$TDM;
249 $$TDD = ($$TDD < 10 && $$TDD !~ /^0/) ? "0" . $$TDD : $$TDD;
250 my $Timestamp = time;
253 $MID = '<%n-%d.%m.%y@'.hostfqdn.'>' if !defined($MID); # set to default if unset
254 $MID =~ s/\%n/$$ActName/g;
255 $MID =~ s/\%d/$$TDD/g;
256 $MID =~ s/\%m/$$TDM/g;
257 $MID =~ s/\%y/$$TDY/g;
258 $MID =~ s/\%t/$Timestamp/g;
261 open (FH, "<$$File");
264 push (@Body, $_), next if $InRealBody;
265 $InRealBody++ if /^$/;
266 $LastModified = $1 if /^Last-modified: (\S+)$/i;
270 push @Body, "\n" if ($Body[-1] ne "\n");
272 #Create Date- and Expires-Header:
273 my @time = localtime;
274 my $ss = ($time[0]<10) ? "0" . $time[0] : $time[0];
275 my $mm = ($time[1]<10) ? "0" . $time[1] : $time[1];
276 my $hh = ($time[2]<10) ? "0" . $time[2] : $time[2];
278 my $month = ($time[4]+1<10) ? "0" . ($time[4]+1) : $time[4]+1;
279 my $monthN = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")[$time[4]];
280 my $wday = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat")[$time[6]];
281 my $year = (1900 + $time[5]);
282 my $tz = $time[8] ? " +0200" : " +0100";
284 $$Expire = '3m' if !$$Expire; # set default if unset: 3 month
286 my ($expY,$expM,$expD) = calcdelta ($year,$month,$day,$$Expire);
287 my $expmonthN = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")[$expM-1];
289 my $date = "$day $monthN $year " . $hh . ":" . $mm . ":" . $ss . $tz;
290 my $expdate = "$expD $expmonthN $expY $hh:$mm:$ss$tz";
292 #Replace %LM by the content of the news.answer-pseudo-header Last-modified:
294 $$Subject =~ s/\%LM/$LastModified/;
298 if($Options{'t'} and $Options{'t'} !~ /console/i) {
299 $$NG = $Options{'t'};
302 #Now create the complete Header:
303 push @Header, "From: $$From\n";
304 push @Header, "Newsgroups: $$NG\n";
305 push @Header, "Followup-To: $$Fup2\n" if $$Fup2;
306 push @Header, "Subject: $$Subject\n";
307 push @Header, "Message-ID: $MID\n";
308 push @Header, "Supersedes: $$Supersedes\n" if $$Supersedes;
309 push @Header, "Date: $date\n";
310 push @Header, "Expires: $expdate\n";
311 push @Header, "Sender: $$Sender\n" if $$Sender;
312 push @Header, "Mime-Version: 1.0\n";
313 push @Header, "Reply-To: $$ReplyTo\n" if $$ReplyTo;
314 push @Header, "Content-Type: text/plain; charset=ISO-8859-15\n";
315 push @Header, "Content-Transfer-Encoding: 8bit\n";
316 push @Header, "User-Agent: yapfaq/$VERSION\n";
317 if ($$ExtraHeaders) {
318 push @Header, "$_\n" for (split /\n/, $$ExtraHeaders);
321 my @Article = (@Header, "\n", @Body);
324 print "$$ActName: Posting article ...\n" if($Options{'v'});
325 my $failure = post(\@Article);
328 print "$$ActName: Posting failed, ERROR.dat may have more information.\n" if($Options{'v'} && (!defined($Options{'t'}) || $Options{'t'} !~ /console/i));
330 updatestatus($ActName, $File, "$day.$month.$year", $MID) if !defined($Options{'t'});
334 ################################## post ##################################
335 # Takes a complete article (Header and Body).
337 # It opens a connection to $NNTPServer and posts the message.
343 # test mode - print article to console
344 if(defined($Options{'t'}) and $Options{'t'} =~ /console/i) {
345 print "-----BEGIN--------------------------------------------------\n";
347 print "------END---------------------------------------------------\n";
348 # pipe article to script
349 } elsif(defined($Options{'s'})) {
350 open (POST, "| $Options{'s'}") or die "$0: E: Cannot fork $Options{'s'}: $!\n";
351 print POST @$ArticleR;
356 warn "$0: W: $Options{'s'} exited with status ", ($? >> 8), "\n";
361 my $NewsConnection = Net::NNTP->new($Config{'NNTPServer'}, Reader => 1) or die "$0: E: Can't connect to news server '$Config{'NNTPServer'}'!\n";
362 $NewsConnection->authinfo ($Config{'NNTPUser'}, $Config{'NNTPPass'}) if (defined($Config{'NNTPUser'}));
363 $NewsConnection->post();
364 $NewsConnection->datasend (@$ArticleR);
365 $NewsConnection->dataend();
367 if ($NewsConnection->ok()) {
369 # Posting failed? Save to ERROR.dat
371 warn "$0: W: Posting failed!\n";
372 open FH, ">>ERROR.dat";
373 print FH "\nPosting failed! Saving to ERROR.dat. Response from news server:\n";
374 print FH $NewsConnection->code();
375 print FH $NewsConnection->message();
378 print FH "-" x 80, "\n";
381 $NewsConnection->quit();
388 ################################ Documentation #################################
392 yapfaq - Post Usenet FAQs I<(yet another postfaq)>
396 B<yapfaq> [B<-Vhvpd>] [B<-t> I<newsgroups> | CONSOLE] [B<-f> I<project name>] [B<-s> I<program>] [B<-c> I<.rc file>]
420 Furthermore you need access to a news server to actually post FAQs.
424 B<yapfaq> posts (one or more) FAQs to Usenet with a certain posting
425 frequency (every n days, weeks, months or years), adding all necessary
426 headers as defined in its config file (by default F<yapfaq.cfg>).
430 F<yapfaq.cfg> consists of one or more blocks, separated by C<=====> on
431 a single line, each containing the configuration for one FAQ as a set
432 of definitions in the form of I<param = value>. Everything after a "#"
433 sign is ignored so you may comment your configuration file.
437 =item B<Name> = I<project name>
439 A name referring to your FAQ, also used for generation of a Message-ID.
441 This value must be set.
443 =item B<File> = I<file name>
445 A file containing the message body of your FAQ and all pseudo headers
446 (subheaders in the news.answers style).
448 This value must be set.
450 =item B<Posting-frequency> = I<time period>
452 The posting frequency defines how often your FAQ will be posted.
453 B<yapfaq> will only post your FAQ if this period of time has passed
454 since the last posting.
456 You can declare that time period either in I<B<d>ays> or I<B<w>weeks>
457 or I<B<m>onths> or I<B<y>ears>.
459 This value must be set.
461 =item B<Expires> = I<time period> (optional)
463 The period of time after which your message will expire. An Expires
464 header will be calculated adding this time period to today's date.
466 You can declare this time period either in I<B<d>ays> or I<B<w>weeks>
467 or I<B<m>onths> or I<B<y>ears>.
469 This setting is optional; the default is 3 months.
471 =item B<From> = I<author>
473 The author of your FAQ as it will appear in the From header of the
476 This value must be set.
478 =item B<Subject> = I<subject>
480 The title of your FAQ as it will appear in the Subject header of the
483 You may use the special string C<%LM> which will be replaced with
484 the contents of the Last-Modified subheader in your I<File>.
486 This value must be set.
488 =item B<NGs> = I<newsgroups>
490 A comma-separated list of newsgroup(s) to post your FAQ to as it will
491 appear in the Newsgroups header of the message.
493 This value must be set.
495 =item B<Fup2> = I<newsgroup | poster> (optional)
497 A comma-separated list of newsgroup(s) or the special string I<poster>
498 as it will appear in the Followup-To header of the message.
500 This setting is optional.
502 =item B<MID-Format> = I<pattern> (optional)
504 A pattern from which the message ID is generated as it will appear in
505 the Message-ID header of the message.
507 You may use the special strings C<%n> for the I<Name> of your project,
508 C<%d> for the date the message is posted, C<%m> for the month, C<%y>
509 for the year and C<%t> for a time stamp (number of seconds since the
510 epoch), respectively.
512 This setting is optional; the default is '<%n-%d.%m.%y@I<YOURHOST>>'
513 where I<YOURHOST> is the fully qualified domain name (FQDN) of the
514 host B<yapfaq> is running on. Obviously that will only work if you
515 have defined a reasonable hostname that the hostfqdn() function of
516 Net::Domain can return.
518 =item B<Supersede> = I<yes> (optional)
520 Add Supersedes header to the message containing the Message-ID header
523 This setting is optional; you should set it to yes or leave it out.
525 =item B<ExtraHeader> = I<additional headers> (optional)
527 The contents of I<ExtraHeader> is added verbatim to the headers of
528 your message so you can add custom headers like Approved.
530 This setting is optional.
534 =head3 Example configuration file
536 # name of your project
539 # file to post (complete body and pseudo-headers)
540 # ($File.cfg contains data on last posting and last MID)
543 # how often your project should be posted
544 # use (d)ay OR (w)eek OR (m)onth OR (y)ear
545 Posting-frequency = '1d'
547 # time period after which the posting should expire
548 # use (d)ay OR (w)eek OR (m)onth OR (y)ear
552 From = 'test@domain.invalid'
555 # (may contain "%LM" which will be replaced by the contents of the
556 # Last-Modified pseudo header).
557 Subject = 'test noreply ignore'
559 # comma-separated list of newsgroup(s) to post to
560 # (header "Newsgroups:")
563 # header "Followup-To:"
566 # Message-ID ("%n" is $Name)
567 # MID-Format = '<%n-%d.%m.%y@domain.invalid>'
569 # Supersede last posting?
572 # extra headers (appended verbatim)
573 # use this for custom headers like "Approved:"
574 ExtraHeader = 'Approved: moderator@domain.invalid
577 # other projects may follow separated with "====="
582 Posting-frequency = '2m'
583 From = 'My Name <my.name@domain.invalid>'
584 Subject = 'Test of yapfag <%LM>'
585 NGs = 'de.test,de.alt.test'
587 MID-Format = '<%n-%m.%y@domain.invalid>'
590 =head3 Status Information
592 Information about the last post and about how to form message IDs for
593 posts is stored in a file named F<I<project name>.cfg> which will be
594 generated if it does not exist. Each of those status files will
595 contain two lines, the first being the date of the last time the FAQ
596 was posted and the second being the message ID of that incarnation.
598 =head2 Runtime Configuration
600 Apart from configuring which FAQ(s) to post you may (re)set some
601 runtime configuration variables via the .rcfile (by default
602 F<.yapfaqrc>). F<.yapfaqrc> must contain one definition in the form of
603 I<param = value> on each line; everything after a "#" sign is ignored.
605 If you omit some settings they will be set to default values hardcoded
608 B<Please note that all parameter names are case-sensitive!>
612 =item B<NNTPServer> = I<NNTP server> (mandatory)
614 Host name of the NNTP server to post to. Must be set (or omitted; the
615 default is "localhost"); if set to en empty string, B<yapfaq> falls
616 back to Perl's build-in defaults (contents of environment variables
617 NNTPSERVER and NEWSHOST; if not set, default from Net::Config; if not
618 set, "news" is used).
620 =item B<NNTPUser> = I<user name> (optional)
622 User name used for authentication with the NNTP server (I<AUTHINFO
625 This setting is optional; if it is not set, I<NNTPPass> is ignored and
626 no authentication is tried.
628 =item B<NNTPPass> = I<password> (optional)
630 Password used for authentication with the NNTP server (I<AUTHINFO
633 This setting is optional; it must be set if I<NNTPUser> is present.
635 =item B<Sender> = I<Sender header> (optional)
637 The Sender header that will be added to every posted message.
639 This setting is optional.
641 =item B<ConfigFile> = I<configuration file> (mandatory)
643 The configuration file defining the FAQ(s) to post. Must be set (or
644 omitted; the default is "yapfaq.cfg").
646 =item B<Program> = I<file name> (optional)
648 A program the article is piped to instead of posting it to Usenet.
649 See option "-f" below (which takes preference).
651 This setting is optional.
655 =head3 Example runtime configuration file
657 NNTPServer = 'localhost'
661 ConfigFile = 'yapfaq.cfg'
664 =head3 Using more than one runtime configuration
666 You may use more than one runtime configuration file with the B<-c>
673 =item B<-V> (version)
675 Print out version and copyright information on B<yapfaq> and exit.
679 Print this man page and exit.
681 =item B<-v> (verbose)
683 Print out status information while running to STDOUT.
685 =item B<-p> (post unconditionally)
687 Post (all) FAQs unconditionally ignoring the posting frequency setting.
689 You may want to use this with the B<-f> option (see below).
691 =item B<-d> (dry run)
693 Start B<yapfaq> in simulation mode, i.e. don't post anything and don't
694 update any status information.
696 =item B<-t> I<newsgroup(s) | CONSOLE> (test)
698 Don't post to the newsgroups defined in F<yqpfaq.cfg>, but to the
699 newsgroups given after B<-t> as a comma-separated list or print the
700 FAQs to STDOUT separated by lines of dashes if the special string
701 C<CONSOLE> is given. This can be used to preview what B<yapfaq> would
702 do without embarassing yourself on Usenet. The status files are not
703 updated when this option is given.
705 You may want to use this with the B<-f> option (see below).
707 =item B<-f> I<project name>
709 Just deal with one FAQ only.
711 By default B<yapfaq> will work on all FAQs that are defined in
712 F<yapfaq.cfg>, check whether they are due for posting and - if they
713 are - post them. Consequently when the B<-p> option is set all FAQs
714 will be posted unconditionally. That may not be what you want to
715 achieve, so you can limit the operation of B<yapfaq> to the named FAQ
718 =item B<-s> I<program> (pipe to script)
720 Instead of posting the article(s) to Usenet pipe them to the external
721 I<program> on STDIN (which may post the article(s) then). A return
722 value of 0 will be considered success.
724 For example, you may want to use the I<inews> utility from the INN package
725 or the much more powerful replacement I<tinews.pl> from
726 I<ftp://ftp.tin.org/tin/tools/tinews.pl> which is able to sign postings.
728 If I<Program> is also defined in the runtime configuration file (by default
729 F<.yapfaqrc>), B<-s> takes preference.
731 =item B<-c> I<.rc file>
733 Load another runtime configuration file (.rc file) than F<.yaofaq.rc>.
735 You may for example define another usenet server to post your FAQ(s)
736 to or load another configuration file defining (an)other FAQ(s).
742 Post all FAQs that are due for posting:
746 Do a dry run, showing which FAQs would be posted:
750 Do a test run and print on STDOUT what the FAQ I<myfaq> would look
751 like when posted, regardless whether it is due for posting or not:
753 yapfaq -pt CONSOLE -f myfaq
755 Do a "real" test run and post the FAQ I<myfaq> to I<de.test>, but only
758 yapfaq -t de.test -f myfaq
760 Post all FAQs (that are due for posting) using inews from INN:
764 Do a dry run using a runtime configuration from .alternaterc, showing
765 which FAQs would be posted:
767 yapfaq -dvc .alternaterc
775 The default NNTP server to post to, used by the Net::NNTP module. You
776 can also specify the server using the runtime configuration file (by
777 default F<.yapfaqrc>).
791 Runtime configuration file for B<yapfaq>.
795 Configuration file for B<yapfaq>.
801 The status files will be created on successful posting if they don't
802 already exist. The first line of the file will be the date of the last
803 time the FAQ was posted and the second line will be the message ID of
804 the last post of that FAQ.
810 Please report any bugs or feature request to the author or use the
811 bug tracker at L<http://bugs.th-h.de/>!
815 L<http://th-h.de/download/scripts.php> will have the current
816 version of this program.
818 This program is maintained using the Git version control system. You
819 may clone L<git://code.th-h.de/usenet/yapfaq.git> to check out the
820 current development tree or browse it on the web via
821 L<http://code.th-h.de/?p=usenet/yapfaq.git>.
825 Thomas Hochstein <thh@inter.net>
827 Original author (up to version 0.5b, dating from 2003):
828 Marc Brockschmidt <marc@marcbrockschmidt.de>
830 =head1 COPYRIGHT AND LICENSE
832 Copyright (c) 2003 Marc Brockschmidt <marc@marcbrockschmidt.de>
834 Copyright (c) 2010 Thomas Hochstein <thh@inter.net>
836 This program is free software; you may redistribute it and/or modify it
837 under the same terms as Perl itself.