3 # yapfaq Version 0.7 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.
15 my $Version = "0.8-prelease";
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');
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");
32 ################################# Main program #################################
36 use Net::Domain qw(hostfqdn);
37 use Date::Calc qw(Add_Delta_YM Add_Delta_Days Delta_Days Today);
38 use Fcntl ':flock'; # import LOCK_* constants
40 my ($TDY, $TDM, $TDD) = Today(); #TD: Today's date
42 # read commandline options
44 getopts('Vhvpdt:f:c:s:', \%Options);
45 # -V: print version / copyright information
47 print "$0 v $Version\nCopyright (c) 2003 Marc Brockschmidt <marc\@marcbrockschmidt.de>\nCopyright (c) 2010 Thomas Hochstein <thh\@inter.net>\n";
48 print "This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.\n";
51 # -h: feed myself to perldoc
57 my ($Faq) = $Options{'f'} if ($Options{'f'});
59 # read runtime configuration (configuration variables)
60 $RCFile = $Options{'c'} if ($Options{'c'});
62 readrc (\$RCFile,\%Config);
64 warn "$0: W: .rc file $RCFile does not exist!\n";
67 # read configuration (configured FAQs)
69 readconfig (\$Config{'ConfigFile'}, \@Config, \$Faq);
72 # - parse configuration
74 # - if FAQ is due: call postfaq()
76 my ($LPD,$LPM,$LPY) = (01, 01, 0001); #LP: Last posting-date
77 my ($NPY,$NPM,$NPD); #NP: Next posting-date
80 my ($ActName,$File,$PFreq,$Expire) =($$_{'name'},$$_{'file'},$$_{'posting-frequency'},$$_{'expires'});
81 my ($From,$Subject,$NG,$Fup2)=($$_{'from'},$$_{'subject'},$$_{'ngs'},$$_{'fup2'});
82 my ($MIDF,$ReplyTo,$ExtHea)=($$_{'mid-format'},$$_{'reply-to'},$$_{'extraheader'});
83 my ($Supersede) =($$_{'supersede'});
85 # -f: loop if not FAQ to post
86 next if (defined($Faq) && $ActName ne $Faq);
89 if (open (FH, "<$File.cfg")) {
91 if (/##;; Lastpost:\s*(\d{1,2})\.(\d{1,2})\.(\d{2}(\d{2})?)/){
92 ($LPD, $LPM, $LPY) = ($1, $2, $3);
93 } elsif (/^##;;\s*LastMID:\s*(<\S+@\S+>)\s*$/) {
99 warn "$0: W: Couldn't open $File.cfg: $!\n";
102 $SupersedeMID = "" unless $Supersede;
104 ($NPY,$NPM,$NPD) = calcdelta ($LPY,$LPM,$LPD,$PFreq);
106 # if FAQ is due: get it out
107 if (Delta_Days($NPY,$NPM,$NPD,$TDY,$TDM,$TDD) >= 0 or ($Options{'p'})) {
109 print "$ActName: Would be posted now (but running in simulation mode [$0 -d]).\n" if $Options{'v'};
111 postfaq(\$ActName,\$File,\$From,\$Subject,\$NG,\$Fup2,\$MIDF,\$ExtHea,\$Config{'Sender'},\$TDY,\$TDM,\$TDD,\$ReplyTo,\$SupersedeMID,\$Expire);
113 } elsif($Options{'v'}) {
114 print "$ActName: Nothing to do.\n";
120 #################################### readrc ####################################
121 # Takes a filename and the reference to an array which contains the valid options
124 my ($File, $Config) = @_;
126 print "Reading $$File.\n" if($Options{'v'});
128 open FH, "<$$File" or die "$0: Can't open $$File: $!";
130 if (/^\s*(\S+)\s*=\s*'?(.*?)'?\s*(#.*$|$)/) {
131 if (grep(/$1/,@ValidConfVars)) {
132 $$Config{$1} = $2 if $2 ne '';
134 warn "$0: W: $1 is not a valid configuration variable (reading from $$File)\n";
140 ################################## readconfig ##################################
141 # Takes a filename, a reference to an array, which will hold hashes with
142 # the data from $File, and - optionally - the name of the (single) FAQ to post
145 my ($File, $Config, $Faq) = @_;
146 my ($LastEntry, $Error, $i) = ('','',0);
148 print "Reading configuration from $$File.\n" if($Options{'v'});
150 open FH, "<$$File" or die "$0: E: Can't open $$File: $!";
152 next if (defined($$Faq) && !/^\s*=====\s*$/ && defined($$Config[$i]{'name'}) && $$Config[$i]{'name'} ne $$Faq );
153 if (/^(\s*(\S+)\s*=\s*'?(.*?)'?\s*(#.*$|$)|^(.*?)'?\s*(#.*$|$))/ && not /^\s*$/) {
154 $LastEntry = lc($2) if $2;
155 $$Config[$i]{$LastEntry} .= $3 if $3;
156 $$Config[$i]{$LastEntry} .= "\n$5" if $5 && $5;
158 if (/^\s*=====\s*$/) {
166 next if (defined($$Faq) && defined($$Config[$i]{'name'}) && $$Config[$i]{'name'} ne $$Faq );
167 unless(defined($$Config[$i]{'name'}) && $$Config[$i]{'name'} =~ /^\S+$/) {
168 $Error .= "E: The name of your project \"$$Config[$i]{'name'}\" is not defined or contains whitespaces.\n"
170 unless(defined($$Config[$i]{'file'}) && -f $$Config[$i]{'file'}) {
171 $Error .= "E: The file to post for your project \"$$Config[$i]{'name'}\" is not defined or does not exist.\n"
173 unless(defined($$Config[$i]{'from'}) && $$Config[$i]{'from'} =~ /\S+\@(\S+\.)?\S{2,}\.\S{2,}/) {
174 $Error .= "E: The From header for your project \"$$Config[$i]{'name'}\" seems to be incorrect.\n"
176 unless(defined($$Config[$i]{'ngs'}) && $$Config[$i]{'ngs'} =~ /^\S+$/) {
177 $Error .= "E: The Newsgroups header for your project \"$$Config[$i]{'name'}\" is not defined or contains whitespaces.\n"
179 unless(defined($$Config[$i]{'subject'})) {
180 $Error .= "E: The Subject header for your project \"$$Config[$i]{'name'}\" is not defined.\n"
182 unless(!$$Config[$i]{'fup2'} || $$Config[$i]{'fup2'} =~ /^\S+$/) {
183 $Error .= "E: The Followup-To header for your project \"$$Config[$i]{'name'}\" contains whitespaces.\n"
185 unless(defined($$Config[$i]{'posting-frequency'}) && $$Config[$i]{'posting-frequency'} =~ /^\s*\d+\s*[dwmy]\s*$/) {
186 $Error .= "E: The Posting-frequency for your project \"$$Config[$i]{'name'}\" is invalid.\n"
188 unless(!$$Config[$i]{'expires'} || $$Config[$i]{'expires'} =~ /^\s*\d+\s*[dwmy]\s*$/) {
189 warn "$0: W: The Expires for your project \"$$Config[$i]{'name'}\" is invalid - set to 3 month.\n";
190 $$Config[$i]{'expires'} = '3m'; # set default (3 month) if expires is unset or invalid
192 unless(!$$Config[$i]{'mid-format'} || $$Config[$i]{'mid-format'} =~ /^<\S+\@(\S+\.)?\S{2,}\.\S{2,}>/) {
193 warn "$0: W: The Message-ID format for your project \"$$Config[$i]{'name'}\" seems to be invalid - set to default.\n";
194 $$Config[$i]{'mid-format'} = '<%n-%d.%m.%y@'.hostfqdn.'>'; # set default if mid-format is invalid
197 $Error .= "-" x 25 . 'program terminated' . "-" x 25 . "\n" if $Error;
198 die $Error if $Error;
201 ################################# calcdelta #################################
202 # Takes a date (year, month and day) and a time period (1d, 1w, 1m, 1y, ...)
203 # and adds the latter to the former
206 my ($Year, $Month, $Day, $Period) = @_;
207 my ($NYear, $NMonth, $NDay);
209 if ($Period =~ /(\d+)\s*([dw])/) { # Is counted in days or weeks: Use Add_Delta_Days.
210 ($NYear, $NMonth, $NDay) = Add_Delta_Days($Year, $Month, $Day, (($2 eq "w")?$1 * 7: $1 * 1));
211 } elsif ($Period =~ /(\d+)\s*([my])/) { #Is counted in months or years: Use Add_Delta_YM
212 ($NYear, $NMonth, $NDay) = Add_Delta_YM($Year, $Month, $Day, (($2 eq "m")?(0,$1):($1,0)));
214 return ($NYear, $NMonth, $NDay);
217 ################################ updatestatus ###############################
218 # Takes a MID and a status file name
219 # and writes status information to disk
222 my ($ActName, $File, $date, $MID) = @_;
224 print "$$ActName: Save status information.\n" if($Options{'v'});
226 open (FH, ">$$File.cfg") or die "$0: E: Can't open $$File.cfg: $!";
227 print FH "##;; Lastpost: $date\n";
228 print FH "##;; LastMID: $MID\n";
232 ################################## postfaq ##################################
233 # Takes a filename and many other vars.
235 # It reads the data-file $File and then posts the article.
238 my ($ActName,$File,$From,$Subject,$NG,$Fup2,$MIDF,$ExtraHeaders,$Sender,$TDY,$TDM,$TDD,$ReplyTo,$Supersedes,$Expire) = @_;
239 my (@Header,@Body,$MID,$InRealBody,$LastModified);
241 print "$$ActName: Preparing to post.\n" if($Options{'v'});
244 $$TDM = ($$TDM < 10 && $$TDM !~ /^0/) ? "0" . $$TDM : $$TDM;
245 $$TDD = ($$TDD < 10 && $$TDD !~ /^0/) ? "0" . $$TDD : $$TDD;
246 my $Timestamp = time;
249 $MID = '<%n-%d.%m.%y@'.hostfqdn.'>' if !defined($MID); # set to default if unset
250 $MID =~ s/\%n/$$ActName/g;
251 $MID =~ s/\%d/$$TDD/g;
252 $MID =~ s/\%m/$$TDM/g;
253 $MID =~ s/\%y/$$TDY/g;
254 $MID =~ s/\%t/$Timestamp/g;
257 open (FH, "<$$File");
260 push (@Body, $_), next if $InRealBody;
261 $InRealBody++ if /^$/;
262 $LastModified = $1 if /^Last-modified: (\S+)$/i;
266 push @Body, "\n" if ($Body[-1] ne "\n");
268 #Create Date- and Expires-Header:
269 my @time = localtime;
270 my $ss = ($time[0]<10) ? "0" . $time[0] : $time[0];
271 my $mm = ($time[1]<10) ? "0" . $time[1] : $time[1];
272 my $hh = ($time[2]<10) ? "0" . $time[2] : $time[2];
274 my $month = ($time[4]+1<10) ? "0" . ($time[4]+1) : $time[4]+1;
275 my $monthN = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")[$time[4]];
276 my $wday = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat")[$time[6]];
277 my $year = (1900 + $time[5]);
278 my $tz = $time[8] ? " +0200" : " +0100";
280 $$Expire = '3m' if !$$Expire; # set default if unset: 3 month
282 my ($expY,$expM,$expD) = calcdelta ($year,$month,$day,$$Expire);
283 my $expmonthN = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")[$expM-1];
285 my $date = "$day $monthN $year " . $hh . ":" . $mm . ":" . $ss . $tz;
286 my $expdate = "$expD $expmonthN $expY $hh:$mm:$ss$tz";
288 #Replace %LM by the content of the news.answer-pseudo-header Last-modified:
290 $$Subject =~ s/\%LM/$LastModified/;
294 if($Options{'t'} and $Options{'t'} !~ /console/i) {
295 $$NG = $Options{'t'};
298 #Now create the complete Header:
299 push @Header, "From: $$From\n";
300 push @Header, "Newsgroups: $$NG\n";
301 push @Header, "Followup-To: $$Fup2\n" if $$Fup2;
302 push @Header, "Subject: $$Subject\n";
303 push @Header, "Message-ID: $MID\n";
304 push @Header, "Supersedes: $$Supersedes\n" if $$Supersedes;
305 push @Header, "Date: $date\n";
306 push @Header, "Expires: $expdate\n";
307 push @Header, "Sender: $$Sender\n" if $$Sender;
308 push @Header, "Mime-Version: 1.0\n";
309 push @Header, "Reply-To: $$ReplyTo\n" if $$ReplyTo;
310 push @Header, "Content-Type: text/plain; charset=ISO-8859-15\n";
311 push @Header, "Content-Transfer-Encoding: 8bit\n";
312 push @Header, "User-Agent: yapfaq/$Version\n";
313 if ($$ExtraHeaders) {
314 push @Header, "$_\n" for (split /\n/, $$ExtraHeaders);
317 my @Article = (@Header, "\n", @Body);
320 print "$$ActName: Posting article ...\n" if($Options{'v'});
321 my $failure = post(\@Article);
324 print "$$ActName: Posting failed, ERROR.dat may have more information.\n" if($Options{'v'} && (!defined($Options{'t'}) || $Options{'t'} !~ /console/i));
326 updatestatus($ActName, $File, "$day.$month.$year", $MID) if !defined($Options{'t'});
330 ################################## post ##################################
331 # Takes a complete article (Header and Body).
333 # It opens a connection to $NNTPServer and posts the message.
339 # test mode - print article to console
340 if(defined($Options{'t'}) and $Options{'t'} =~ /console/i) {
341 print "-----BEGIN--------------------------------------------------\n";
343 print "------END---------------------------------------------------\n";
344 # pipe article to script
345 } elsif(defined($Options{'s'})) {
346 open (POST, "| $Options{'s'}") or die "$0: E: Cannot fork $Options{'s'}: $!\n";
347 print POST @$ArticleR;
352 warn "$0: W: $Options{'s'} exited with status ", ($? >> 8), "\n";
357 my $NewsConnection = Net::NNTP->new($Config{'NNTPServer'}, Reader => 1) or die "$0: E: Can't connect to news server '$Config{'NNTPServer'}'!\n";
358 $NewsConnection->authinfo ($Config{'NNTPUser'}, $Config{'NNTPPass'}) if (defined($Config{'NNTPUser'}));
359 $NewsConnection->post();
360 $NewsConnection->datasend (@$ArticleR);
361 $NewsConnection->dataend();
363 if ($NewsConnection->ok()) {
365 # Posting failed? Save to ERROR.dat
367 warn "$0: W: Posting failed!\n";
368 open FH, ">>ERROR.dat";
369 print FH "\nPosting failed! Saving to ERROR.dat. Response from news server:\n";
370 print FH $NewsConnection->code();
371 print FH $NewsConnection->message();
374 print FH "-" x 80, "\n";
377 $NewsConnection->quit();
384 ################################ Documentation #################################
388 yapfaq - Post Usenet FAQs I<(yet another postfaq)>
392 B<yapfaq> [B<-Vhvpd>] [B<-t> I<newsgroups> | CONSOLE] [B<-f> I<project name>] [B<-s> I<program>] [B<-c> I<.rc file>]
416 Furthermore you need access to a news server to actually post FAQs.
420 B<yapfaq> posts (one or more) FAQs to Usenet with a certain posting
421 frequency (every n days, weeks, months or years), adding all necessary
422 headers as defined in its config file (by default F<yapfaq.cfg>).
426 F<yapfaq.cfg> consists of one or more blocks, separated by C<=====> on
427 a single line, each containing the configuration for one FAQ as a set
428 of definitions in the form of I<param = value>. Everything after a "#"
429 sign is ignored so you may comment your configuration file.
433 =item B<Name> = I<project name>
435 A name referring to your FAQ, also used for generation of a Message-ID.
437 This value must be set.
439 =item B<File> = I<file name>
441 A file containing the message body of your FAQ and all pseudo headers
442 (subheaders in the news.answers style).
444 This value must be set.
446 =item B<Posting-frequency> = I<time period>
448 The posting frequency defines how often your FAQ will be posted.
449 B<yapfaq> will only post your FAQ if this period of time has passed
450 since the last posting.
452 You can declare that time period either in I<B<d>ays> or I<B<w>weeks>
453 or I<B<m>onths> or I<B<y>ears>.
455 This value must be set.
457 =item B<Expires> = I<time period> (optional)
459 The period of time after which your message will expire. An Expires
460 header will be calculated adding this time period to today's date.
462 You can declare this time period either in I<B<d>ays> or I<B<w>weeks>
463 or I<B<m>onths> or I<B<y>ears>.
465 This setting is optional; the default is 3 months.
467 =item B<From> = I<author>
469 The author of your FAQ as it will appear in the From header of the
472 This value must be set.
474 =item B<Subject> = I<subject>
476 The title of your FAQ as it will appear in the Subject header of the
479 You may use the special string C<%LM> which will be replaced with
480 the contents of the Last-Modified subheader in your I<File>.
482 This value must be set.
484 =item B<NGs> = I<newsgroups>
486 A comma-separated list of newsgroup(s) to post your FAQ to as it will
487 appear in the Newsgroups header of the message.
489 This value must be set.
491 =item B<Fup2> = I<newsgroup | poster> (optional)
493 A comma-separated list of newsgroup(s) or the special string I<poster>
494 as it will appear in the Followup-To header of the message.
496 This setting is optional.
498 =item B<MID-Format> = I<pattern> (optional)
500 A pattern from which the message ID is generated as it will appear in
501 the Message-ID header of the message.
503 You may use the special strings C<%n> for the I<Name> of your project,
504 C<%d> for the date the message is posted, C<%m> for the month, C<%y>
505 for the year and C<%t> for a time stamp (number of seconds since the
506 epoch), respectively.
508 This setting is optional; the default is '<%n-%d.%m.%y@I<YOURHOST>>'
509 where I<YOURHOST> is the fully qualified domain name (FQDN) of the
510 host B<yapfaq> is running on. Obviously that will only work if you
511 have defined a reasonable hostname that the hostfqdn() function of
512 Net::Domain can return.
514 =item B<Supersede> = I<yes> (optional)
516 Add Supersedes header to the message containing the Message-ID header
519 This setting is optional; you should set it to yes or leave it out.
521 =item B<ExtraHeader> = I<additional headers> (optional)
523 The contents of I<ExtraHeader> is added verbatim to the headers of
524 your message so you can add custom headers like Approved.
526 This setting is optional.
530 =head3 Example configuration file
532 # name of your project
535 # file to post (complete body and pseudo-headers)
536 # ($File.cfg contains data on last posting and last MID)
539 # how often your project should be posted
540 # use (d)ay OR (w)eek OR (m)onth OR (y)ear
541 Posting-frequency = '1d'
543 # time period after which the posting should expire
544 # use (d)ay OR (w)eek OR (m)onth OR (y)ear
548 From = 'test@domain.invalid'
551 # (may contain "%LM" which will be replaced by the contents of the
552 # Last-Modified pseudo header).
553 Subject = 'test noreply ignore'
555 # comma-separated list of newsgroup(s) to post to
556 # (header "Newsgroups:")
559 # header "Followup-To:"
562 # Message-ID ("%n" is $Name)
563 # MID-Format = '<%n-%d.%m.%y@domain.invalid>'
565 # Supersede last posting?
568 # extra headers (appended verbatim)
569 # use this for custom headers like "Approved:"
570 ExtraHeader = 'Approved: moderator@domain.invalid
573 # other projects may follow separated with "====="
578 Posting-frequency = '2m'
579 From = 'My Name <my.name@domain.invalid>'
580 Subject = 'Test of yapfag <%LM>'
581 NGs = 'de.test,de.alt.test'
583 MID-Format = '<%n-%m.%y@domain.invalid>'
586 =head3 Status Information
588 Information about the last post and about how to form message IDs for
589 posts is stored in a file named F<I<project name>.cfg> which will be
590 generated if it does not exist. Each of those status files will
591 contain two lines, the first being the date of the last time the FAQ
592 was posted and the second being the message ID of that incarnation.
594 =head2 Runtime Configuration
596 Apart from configuring which FAQ(s) to post you may (re)set some
597 runtime configuration variables via the .rcfile (by default
598 F<.yapfaqrc>). F<.yapfaqrc> must contain one definition in the form of
599 I<param = value> on each line; everything after a "#" sign is ignored.
601 If you omit some settings they will be set to default values hardcoded
604 B<Please note that all parameter names are case-sensitive!>
608 =item B<NNTPServer> = I<NNTP server> (mandatory)
610 Host name of the NNTP server to post to. Must be set (or omitted; the
611 default is "localhost"); if set to en empty string, B<yapfaq> falls
612 back to Perl's build-in defaults (contents of environment variables
613 NNTPSERVER and NEWSHOST; if not set, default from Net::Config; if not
614 set, "news" is used).
616 =item B<NNTPUser> = I<user name> (optional)
618 User name used for authentication with the NNTP server (I<AUTHINFO
621 This setting is optional; if it is not set, I<NNTPPass> is ignored and
622 no authentication is tried.
624 =item B<NNTPPass> = I<password> (optional)
626 Password used for authentication with the NNTP server (I<AUTHINFO
629 This setting is optional; it must be set if I<NNTPUser> is present.
631 =item B<Sender> = I<Sender header> (optional)
633 The Sender header that will be added to every posted message.
635 This setting is optional.
637 =item B<ConfigFile> = I<configuration file> (mandatory)
639 The configuration file defining the FAQ(s) to post. Must be set (or
640 omitted; the default is "yapfaq.cfg").
644 =head3 Example runtime configuration file
646 NNTPServer = 'localhost'
650 ConfigFile = 'yapfaq.cfg'
652 =head3 Using more than one runtime configuration
654 You may use more than one runtime configuration file with the B<-c>
661 =item B<-V> (version)
663 Print out version and copyright information on B<yapfaq> and exit.
667 Print this man page and exit.
669 =item B<-v> (verbose)
671 Print out status information while running to STDOUT.
673 =item B<-p> (post unconditionally)
675 Post (all) FAQs unconditionally ignoring the posting frequency setting.
677 You may want to use this with the B<-f> option (see below).
679 =item B<-d> (dry run)
681 Start B<yapfaq> in simulation mode, i.e. don't post anything and don't
682 update any status information.
684 =item B<-t> I<newsgroup(s) | CONSOLE> (test)
686 Don't post to the newsgroups defined in F<yqpfaq.cfg>, but to the
687 newsgroups given after B<-t> as a comma-separated list or print the
688 FAQs to STDOUT separated by lines of dashes if the special string
689 C<CONSOLE> is given. This can be used to preview what B<yapfaq> would
690 do without embarassing yourself on Usenet. The status files are not
691 updated when this option is given.
693 You may want to use this with the B<-f> option (see below).
695 =item B<-f> I<project name>
697 Just deal with one FAQ only.
699 By default B<yapfaq> will work on all FAQs that are defined in
700 F<yapfaq.cfg>, check whether they are due for posting and - if they
701 are - post them. Consequently when the B<-p> option is set all FAQs
702 will be posted unconditionally. That may not be what you want to
703 achieve, so you can limit the operation of B<yapfaq> to the named FAQ
706 =item B<-s> I<program> (pipe to script)
708 Instead of posting the article(s) to Usenet pipe them to the external
709 I<program> on STDIN (which may post the article(s) then). A return
710 value of 0 will be considered success.
712 For example, you may want to use the I<inews> utility from the INN package
713 or the much more powerful replacement I<tinews.pl> from
714 I<ftp://ftp.tin.org/tin/tools/tinews.pl> which is able to sign postings.
716 =item B<-c> I<.rc file>
718 Load another runtime configuration file (.rc file) than F<.yaofaq.rc>.
720 You may for example define another usenet server to post your FAQ(s)
721 to or load another configuration file defining (an)other FAQ(s).
727 Post all FAQs that are due for posting:
731 Do a dry run, showing which FAQs would be posted:
735 Do a test run and print on STDOUT what the FAQ I<myfaq> would look
736 like when posted, regardless whether it is due for posting or not:
738 yapfaq -pt CONSOLE -f myfaq
740 Do a "real" test run and post the FAQ I<myfaq> to I<de.test>, but only
743 yapfaq -t de.test -f myfaq
745 Post all FAQs (that are due for posting) using inews from INN:
749 Do a dry run using a runtime configuration from .alternaterc, showing
750 which FAQs would be posted:
752 yapfaq -dvc .alternaterc
760 The default NNTP server to post to, used by the Net::NNTP module. You
761 can also specify the server using the runtime configuration file (by
762 default F<.yapfaqrc>).
776 Runtime configuration file for B<yapfaq>.
780 Configuration file for B<yapfaq>.
786 The status files will be created on successful posting if they don't
787 already exist. The first line of the file will be the date of the last
788 time the FAQ was posted and the second line will be the message ID of
789 the last post of that FAQ.
799 L<http://th-h.de/download/scripts.php> will have the current
800 version of this program.
804 Thomas Hochstein <thh@inter.net>
806 Original author (up to version 0.5b, dating from 2003):
807 Marc Brockschmidt <marc@marcbrockschmidt.de>
809 =head1 COPYRIGHT AND LICENSE
811 Copyright (c) 2003 Marc Brockschmidt <marc@marcbrockschmidt.de>
813 Copyright (c) 2010 Thomas Hochstein <thh@inter.net>
815 This program is free software; you may redistribute it and/or modify it
816 under the same terms as Perl itself.