Add %t placeholder for Message-ID.
Feature parity with 0.9 Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
parent
be767b2fbe
commit
d770c7e3da
2 changed files with 10 additions and 6 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
yapfaq 1.0.1 (unreleased)
|
yapfaq 1.0.1 (unreleased)
|
||||||
|
* Add %t placeholder for Message-ID (feature parity with 0.9).
|
||||||
|
|
||||||
yapfaq 1.0.0 (2025-01-23)
|
yapfaq 1.0.0 (2025-01-23)
|
||||||
* Complete rewrite.
|
* Complete rewrite.
|
||||||
|
|
|
||||||
|
|
@ -464,15 +464,18 @@ sub BuildPosting {
|
||||||
# %m current month
|
# %m current month
|
||||||
# %d current day
|
# %d current day
|
||||||
# %p PID
|
# %p PID
|
||||||
|
# %t timestamp (seconds since epoch)
|
||||||
if (/^Message-ID: /i) {
|
if (/^Message-ID: /i) {
|
||||||
my $TDY = $TD->strftime('%Y');
|
my $TDY = $TD->strftime('%Y');
|
||||||
my $TDM = $TD->strftime('%m');
|
my $TDM = $TD->strftime('%m');
|
||||||
my $TDD = $TD->strftime('%d');
|
my $TDD = $TD->strftime('%d');
|
||||||
|
my $TimeStamp = time;
|
||||||
$_ =~ s/\%n/$Project/g;
|
$_ =~ s/\%n/$Project/g;
|
||||||
$_ =~ s/\%y/$TDY/g;
|
$_ =~ s/\%y/$TDY/g;
|
||||||
$_ =~ s/\%m/$TDM/g;
|
$_ =~ s/\%m/$TDM/g;
|
||||||
$_ =~ s/\%d/$TDD/g;
|
$_ =~ s/\%d/$TDD/g;
|
||||||
$_ =~ s/\%p/$$/g;
|
$_ =~ s/\%p/$$/g;
|
||||||
|
$_ =~ s/\%t/$TimeStamp/g;
|
||||||
# add random part in test mode
|
# add random part in test mode
|
||||||
if ($OptTest) {
|
if ($OptTest) {
|
||||||
my $random = sprintf("%08X", rand(0xFFFFFFFF));
|
my $random = sprintf("%08X", rand(0xFFFFFFFF));
|
||||||
|
|
@ -747,11 +750,12 @@ curly brackets and spaces) is removed.
|
||||||
If a I<Message-ID:> header is present, placeholders in that header
|
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
|
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
|
year (YYYY), I<%m> with the current month (MM), I<%d> with the
|
||||||
current day (DD) and I<%p> with the current process ID (PID) of
|
current day (DD), I<%p> with the current process ID (PID) of
|
||||||
B<yapfaq>. If no I<Message-ID:> header is present, the I<Message-ID>
|
B<yapfaq> and I<%t> with a timestamp timestamp (seconds since epoch).
|
||||||
will be generated with the hostname of the system B<yapfaq> is
|
If no I<Message-ID:> header is present, the I<Message-ID> will be
|
||||||
running on and I<%n-%y-%m-%d> as template for the left hand side. If
|
generated with the hostname of the system B<yapfaq> is running on and
|
||||||
the I<Message-ID:> header in the headers file does not contain
|
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.
|
placeholders, the next repost will most probably fail.
|
||||||
|
|
||||||
If an I<Expires:> header is present, it must contain a time period of
|
If an I<Expires:> header is present, it must contain a time period of
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue