X-Git-Url: https://code.th-h.de/?p=usenet%2Fyapfaq.git;a=blobdiff_plain;f=yapfaq.pl;h=d4e381eec37e472e9489f6e7e45b7b6b33faaeaa;hp=57ca99b9c7ff0480030d96a738cb9f43a43ffb6b;hb=13ce8c26a3ae0e0d875905741c354c889e2a7903;hpb=9817f98a9132dddfa816b9323e85f54aba39581d diff --git a/yapfaq.pl b/yapfaq.pl index 57ca99b..d4e381e 100644 --- a/yapfaq.pl +++ b/yapfaq.pl @@ -14,12 +14,17 @@ my $Version = "0.8-prelease"; +# Please do not change this setting! +# You may override the default .rc file (.yapfaqrc) by using "-c .rc file" my $RCFile = '.yapfaqrc'; +# Valid configuration variables for use in a .rc file my @ValidConfVars = ('NNTPServer','NNTPUser','NNTPPass','Sender','ConfigFile', 'UsePGP','pgp','PGPVersion','PGPSigner','PGPPass', 'PathtoPGPPass','pgpbegin','pgpend','pgptmpf','pgpheader'); -################################### Defaults ################################## +################################### Defaults ################################### +# Please do not change anything in here! +# Use a runtime configuration file (.yapfaqrc by default) to override defaults. my %Config = (NNTPServer => "", NNTPUser => "", NNTPPass => "", @@ -50,7 +55,7 @@ my @PGPorderheaders = ('from', 'newsgroups', 'subject', 'control', 'content-transfer-encoding', 'summary', 'keywords', 'cancel-lock', 'cancel-key', 'also-control', 'x-pgp', 'user-agent'); -############################# End of Configuration ############################# +################################# Main program ################################# use strict; use Net::NNTP; @@ -264,6 +269,7 @@ sub postfaq { #Prepare MID: $$TDM = ($$TDM < 10 && $$TDM !~ /^0/) ? "0" . $$TDM : $$TDM; $$TDD = ($$TDD < 10 && $$TDD !~ /^0/) ? "0" . $$TDD : $$TDD; + my $Timestamp = time; $MID = $$MIDF; $MID = '<%n-%d.%m.%y@'.hostfqdn.'>' if !defined($MID); # set to default if unset @@ -271,6 +277,7 @@ sub postfaq { $MID =~ s/\%d/$$TDD/g; $MID =~ s/\%m/$$TDM/g; $MID =~ s/\%y/$$TDY/g; + $MID =~ s/\%t/$Timestamp/g; #Now get the body: open (FH, "<$$File"); @@ -684,8 +691,9 @@ A pattern from which the message ID is generated as it will appear in the Message-ID header of the message. You may use the special strings C<%n> for the I of your project, -C<%d> for the date the message is posted, C<%m> for the month and -C<%y> for the year, respectively. +C<%d> for the date the message is posted, C<%m> for the month, C<%y> +for the year and C<%t> for a time stamp (number of seconds since the +epoch), respectively. This setting is optional; the default is '<%n-%d.%m.%y@I>' where I is the fully qualified domain name (FQDN) of the