X-Git-Url: https://code.th-h.de/?p=usenet%2Fyapfaq.git;a=blobdiff_plain;f=yapfaq.pl;h=50928277f62f6c05974e72e89055c2e5a843d147;hp=0e141e52bcd81ceb3d60f633124454b65cb8cb4d;hb=refs%2Ftags%2Fv0.7;hpb=5a6670c7ff54e30051018ff1e333e314ffa0d2dc diff --git a/yapfaq.pl b/yapfaq.pl index 0e141e5..5092827 100644 --- a/yapfaq.pl +++ b/yapfaq.pl @@ -1,6 +1,6 @@ #! /usr/bin/perl -W # -# yapfaq Version 0.6 by Thomas Hochstein +# yapfaq Version 0.7 by Thomas Hochstein # (Original author: Marc Brockschmidt) # # This script posts any project described in its config-file. Most people @@ -12,7 +12,7 @@ # It can be redistributed and/or modified under the same terms under # which Perl itself is published. -my $Version = "0.6.2"; +my $Version = "0.7"; my $RCFile = '.yapfaqrc'; my @ValidConfVars = ('NNTPServer','NNTPUser','NNTPPass','Sender','ConfigFile', @@ -207,10 +207,12 @@ sub readconfig{ $Error .= "E: The Posting-frequency for your project \"$$Config[$i]{'name'}\" is invalid.\n" } unless(!$$Config[$i]{'expires'} || $$Config[$i]{'expires'} =~ /^\s*\d+\s*[dwmy]\s*$/) { - warn "$0: W: The Expires for your project \"$$Config[$i]{'name'}\" is invalid - set to 3 month.\n"; + warn "$0: W: The Expires for your project \"$$Config[$i]{'name'}\" is invalid - set to 3 month.\n"; + $$Config[$i]{'expires'} = '3m'; # set default (3 month) if expires is unset or invalid } - unless(defined($$Config[$i]{'mid-format'}) && $$Config[$i]{'mid-format'} =~ /^<\S+\@\S{2,}\.\S{2,}>$/) { - warn "$0: W: The Expires for your project \"$$Config[$i]{'name'}\" seems to be invalid - set to default.\n"; + unless(!$$Config[$i]{'mid-format'} || $$Config[$i]{'mid-format'} =~ /^<\S+\@\S{2,}\.\S{2,}>$/) { + warn "$0: W: The Message-ID format for your project \"$$Config[$i]{'name'}\" seems to be invalid - set to default.\n"; + $$Config[$i]{'mid-format'} = '<%n-%d.%m.%y@'.hostfqdn.'>'; # set default if mid-format is invalid } } $Error .= "-" x 25 . 'program terminated' . "-" x 25 . "\n" if $Error; @@ -264,7 +266,7 @@ sub postfaq { $$TDD = ($$TDD < 10 && $$TDD !~ /^0/) ? "0" . $$TDD : $$TDD; $MID = $$MIDF; - $MID = '<%n-%d.%m.%y@'.hostfqdn.'>' if !defined($MID); + $MID = '<%n-%d.%m.%y@'.hostfqdn.'>' if !defined($MID); # set to default if unset $MID =~ s/\%n/$$ActName/g; $MID =~ s/\%d/$$TDD/g; $MID =~ s/\%m/$$TDM/g; @@ -635,7 +637,7 @@ or Ionths> or Iears>. This value must be set. -=item B = I