Compare commits

..

No commits in common. "e1a5b7193a3afcd8cdef1159c8995f1a0c18b166" and "f391b09212c05dfe8b46bd86a50872f3b41be8b4" have entirely different histories.

2 changed files with 9 additions and 15 deletions

View file

@ -1,7 +1,3 @@
yapfaq 1.0.1 (unreleased)
* Add %t placeholder for Message-ID (feature parity with 0.9).
* Remove debugging code.
yapfaq 1.0.0 (2025-01-23)
* Complete rewrite.
* Add POD.

View file

@ -19,7 +19,7 @@
# It can be redistributed and/or modified under the same terms under
# which Perl itself is published.
my $VERSION = "1.0.1-unreleased";
my $VERSION = "1.0.0";
(my $NAME = $0) =~ s#^.*/##;
use utf8;
@ -32,6 +32,8 @@ use Path::Tiny; # CPAN
use Getopt::Long qw(GetOptions);
Getopt::Long::config ('bundling');
use Data::Dumper;
# configuration #######################
# may be overwritten via ~/.yapfaqrc or command line
my %Config;
@ -262,7 +264,7 @@ sub AddDuration {
### ------------------------------------------------------------------
### return a hash of all headers (ignoring duplicate headers)
# taken and modified from pgpverify.pl
# taken and modified from tinews.pl
sub ParseHeaders {
my @Headers = @_;
my (%Header, $Label, $Value);
@ -462,18 +464,15 @@ sub BuildPosting {
# %m current month
# %d current day
# %p PID
# %t timestamp (seconds since epoch)
if (/^Message-ID: /i) {
my $TDY = $TD->strftime('%Y');
my $TDM = $TD->strftime('%m');
my $TDD = $TD->strftime('%d');
my $TimeStamp = time;
$_ =~ s/\%n/$Project/g;
$_ =~ s/\%y/$TDY/g;
$_ =~ s/\%m/$TDM/g;
$_ =~ s/\%d/$TDD/g;
$_ =~ s/\%p/$$/g;
$_ =~ s/\%t/$TimeStamp/g;
# add random part in test mode
if ($OptTest) {
my $random = sprintf("%08X", rand(0xFFFFFFFF));
@ -748,12 +747,11 @@ curly brackets and spaces) is removed.
If a I<Message-ID:> header is present, placeholders in that header
will be replaced: I<%n> with the project name, I<%y> with the current
year (YYYY), I<%m> with the current month (MM), I<%d> with the
current day (DD), I<%p> with the current process ID (PID) of
B<yapfaq> and I<%t> with a timestamp timestamp (seconds since epoch).
If no I<Message-ID:> header is present, the I<Message-ID> will be
generated with the hostname of the system B<yapfaq> is running on and
I<%n-%y-%m-%d> as template for the left hand side. If the
I<Message-ID:> header in the headers file does not contain
current day (DD) and I<%p> with the current process ID (PID) of
B<yapfaq>. If no I<Message-ID:> header is present, the I<Message-ID>
will be generated with the hostname of the system B<yapfaq> is
running on and I<%n-%y-%m-%d> as template for the left hand side. If
the I<Message-ID:> header in the headers file does not contain
placeholders, the next repost will most probably fail.
If an I<Expires:> header is present, it must contain a time period of