From 41d307a2fefc76593dc3be8d12b22929fc555031 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 7 Feb 2026 18:48:27 +0100 Subject: [PATCH 1/5] Accept a posting-frequency of "never", too. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8daa92..1500766 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ yapfaq 1.1.0 (unreleased) * --test: Set Supersedes and don't modify Message-ID if -o is set. * --test: Force -o if -n is not set. * Add conversion script for old status files. + * Accept a posting-frequency of "never", too. yapfaq 1.0.1 (2025-01-24) * Add %t placeholder for Message-ID (feature parity with 0.9). diff --git a/bin/yapfaq.pl b/bin/yapfaq.pl index be517c0..eebe9b7 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -515,8 +515,8 @@ sub BuildPosting { } } - # not due if Posting-Freqency is "none" - if ($PostingFrequency =~ /none/) { + # not due if Posting-Freqency is "none" or never + if ($PostingFrequency =~ /none|never/) { print "... is disabled.\n" if $Config{'verbose'} or $Config{'debug'}; return ''; } From 3801b61d7720ce3a08c53e13edd8fd1412104ce9 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 7 Feb 2026 18:48:57 +0100 Subject: [PATCH 2/5] Check for illegal headers and stop posting. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1500766..8851f28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ yapfaq 1.1.0 (unreleased) * --test: Force -o if -n is not set. * Add conversion script for old status files. * Accept a posting-frequency of "never", too. + * Check for illegal headers and stop posting, if found. yapfaq 1.0.1 (2025-01-24) * Add %t placeholder for Message-ID (feature parity with 0.9). diff --git a/bin/yapfaq.pl b/bin/yapfaq.pl index eebe9b7..11494cc 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -412,6 +412,17 @@ sub BuildPosting { return ''; } + # check for illegal headers + my $FoundIllegalHeader = 0; + foreach (qw/Date User-Agent X-Newsreader X-Mailer Injection-Date + Injection-Info NNTP-Posting-Date NNTP-Posting-Host X-Trace/) { + if ($Header{lc($_)}) { + warn "W: $_ header may not be set in '$HeaderFile'.\n"; + $FoundIllegalHeader = 1; + } + } + return '' if $FoundIllegalHeader; + # add Date: push @Headers, 'Date: ' . $TD->strftime('%a, %d %b %Y %H:%M:%S %z') . "\n"; # add missing Message-ID: From 1e7bccbbec7d0ecd65b3e98bcca8b6e61e952331 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 7 Feb 2026 18:59:38 +0100 Subject: [PATCH 3/5] Disabled projects must be posted, if forced. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8851f28..c2cabf1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ yapfaq 1.1.0 (unreleased) * Add conversion script for old status files. * Accept a posting-frequency of "never", too. * Check for illegal headers and stop posting, if found. + * Disabled projects must be posted, if forced. yapfaq 1.0.1 (2025-01-24) * Add %t placeholder for Message-ID (feature parity with 0.9). diff --git a/bin/yapfaq.pl b/bin/yapfaq.pl index 11494cc..81b645d 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -527,7 +527,7 @@ sub BuildPosting { } # not due if Posting-Freqency is "none" or never - if ($PostingFrequency =~ /none|never/) { + if ($PostingFrequency =~ /none|never/ && !$OptForce) { print "... is disabled.\n" if $Config{'verbose'} or $Config{'debug'}; return ''; } From cc881f7897a28a561987a32b1bc6d999e0e73418 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 7 Feb 2026 19:20:10 +0100 Subject: [PATCH 4/5] Warn of unencoded 8bit characters in header or body if -d is set. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index c2cabf1..0c6c23f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ yapfaq 1.1.0 (unreleased) * Accept a posting-frequency of "never", too. * Check for illegal headers and stop posting, if found. * Disabled projects must be posted, if forced. + * Warn of unencoded 8bit characters in header or body if -d is set. yapfaq 1.0.1 (2025-01-24) * Add %t placeholder for Message-ID (feature parity with 0.9). diff --git a/bin/yapfaq.pl b/bin/yapfaq.pl index 81b645d..f7af3f7 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -430,6 +430,16 @@ sub BuildPosting { # add User-Agent push @Headers, "User-Agent: $NAME/$VERSION\n"; + # check for unencoded 8bit characters in header or body in --debug mode + # taken from tinews.pl + if ($Config{'debug'}) { + print "- Raw 8-bit data in headers.\n" if (grep {/[\x80-\xff]/} @Headers); + # check for MIME headers and warn for 8bit characters in body if missing + if (!defined($Header{'mime-version'}) || !defined($Header{'content-type'})) { + print "- 8bit data in body without MIME-headers.\n" if (grep {/[\x80-\xff]/} @Body); + } + } + # parse pseudo headers from body my ($InRealBody,$LastModified,$PostingFrequency); foreach (@Body) { From 66435ceda0749847af9da16ed3df5cbf79936790 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 7 Feb 2026 19:21:03 +0100 Subject: [PATCH 5/5] Update POD. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c6c23f..c8db122 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ yapfaq 1.1.0 (unreleased) * Check for illegal headers and stop posting, if found. * Disabled projects must be posted, if forced. * Warn of unencoded 8bit characters in header or body if -d is set. + * Update POD. yapfaq 1.0.1 (2025-01-24) * Add %t placeholder for Message-ID (feature parity with 0.9). diff --git a/bin/yapfaq.pl b/bin/yapfaq.pl index f7af3f7..3c018d1 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -761,7 +761,14 @@ files need to be in B. Needs to have at least I, I and I and can contain all other headers that the posting should have. Headers must conform to RFC 5536 and RFC 5322 and use MIME encoded words for -8bit characters. B won't convert headers. +8bit characters. B won't convert headers, but will warn of +unencoded 8bit characters in B<--debug> mode. Longer headers should +be folded; B won't fold headers. + +The headers file must not contain any of the following headers: +I, I, I, I, +I, I, I, +I or I. I may contain a I<%LM> placeholder that will be replaced with the I pseudo-header from the text file @@ -823,7 +830,8 @@ I and I will be evaluated by B. If your content contains 8bit characters, you'll need suitable MIME -headers in your headers file. +headers in your headers file. B will warn of unencoded 8bit +characters with missung MIME headers in B<--debug> mode. B